From c69e7b0325b9098cd5a7fc65331de6cb5d66347e Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Thu, 29 Aug 2024 13:12:57 -0400 Subject: [PATCH] Bump RBI dependency to v0.2 Signed-off-by: Alexandre Terrasa --- Gemfile.lock | 8 +- .../{prism@0.30.0.rbi => prism@1.0.0.rbi} | 19199 +++++++--------- .../gems/{rbi@0.1.14.rbi => rbi@0.2.0.rbi} | 1248 +- tapioca.gemspec | 2 +- 4 files changed, 8769 insertions(+), 11688 deletions(-) rename sorbet/rbi/gems/{prism@0.30.0.rbi => prism@1.0.0.rbi} (56%) rename sorbet/rbi/gems/{rbi@0.1.14.rbi => rbi@0.2.0.rbi} (72%) diff --git a/Gemfile.lock b/Gemfile.lock index ea91cb3e6..ed4d9c663 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,7 +12,7 @@ PATH bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) - rbi (>= 0.1.14, < 0.2) + rbi (~> 0.2) sorbet-static-and-runtime (>= 0.5.11087) spoom (>= 1.2.0) thor (>= 1.2.0) @@ -224,7 +224,7 @@ GEM parser (3.3.4.0) ast (~> 2.4.1) racc - prism (0.30.0) + prism (1.0.0) psych (5.1.2) stringio public_suffix (5.0.5) @@ -268,8 +268,8 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rbi (0.1.14) - prism (>= 0.18.0, < 1.0.0) + rbi (0.2.0) + prism (~> 1.0) sorbet-runtime (>= 0.5.9204) rdoc (6.7.0) psych (>= 4.0.0) diff --git a/sorbet/rbi/gems/prism@0.30.0.rbi b/sorbet/rbi/gems/prism@1.0.0.rbi similarity index 56% rename from sorbet/rbi/gems/prism@0.30.0.rbi rename to sorbet/rbi/gems/prism@1.0.0.rbi index 9aec9c308..2df0aed8b 100644 --- a/sorbet/rbi/gems/prism@0.30.0.rbi +++ b/sorbet/rbi/gems/prism@1.0.0.rbi @@ -7,6 +7,11 @@ # typed: strict +# =begin +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/rbi/prism/dsl.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/node.rbi.erb @@ -135,17 +140,17 @@ end # cannot be applied to sources that include multibyte characters. Sources that # include multibyte characters are represented by the Prism::Source class. # -# source://prism//lib/prism/parse_result.rb#126 +# source://prism//lib/prism/parse_result.rb#135 class Prism::ASCIISource < ::Prism::Source # Return the column number in characters for the given byte offset. # - # source://prism//lib/prism/parse_result.rb#133 + # source://prism//lib/prism/parse_result.rb#142 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#128 + # source://prism//lib/prism/parse_result.rb#137 sig { params(byte_offset: Integer).returns(Integer) } def character_offset(byte_offset); end @@ -153,7 +158,7 @@ class Prism::ASCIISource < ::Prism::Source # `code_units_offset`, which is a more expensive operation. This is # essentialy the same as `Prism::Source#column`. # - # source://prism//lib/prism/parse_result.rb#150 + # source://prism//lib/prism/parse_result.rb#159 sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } def code_units_column(byte_offset, encoding); end @@ -164,7 +169,7 @@ class Prism::ASCIISource < ::Prism::Source # concept of code units that differs from the number of characters in other # encodings, it is not captured here. # - # source://prism//lib/prism/parse_result.rb#143 + # source://prism//lib/prism/parse_result.rb#152 sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } def code_units_offset(byte_offset, encoding); end end @@ -174,78 +179,55 @@ end # alias $foo $bar # ^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#176 +# source://prism//lib/prism/node.rb#227 class Prism::AliasGlobalVariableNode < ::Prism::Node - # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void + # Initialize a new AliasGlobalVariableNode node. # # @return [AliasGlobalVariableNode] a new instance of AliasGlobalVariableNode # - # source://prism//lib/prism/node.rb#178 - 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 + # source://prism//lib/prism/node.rb#229 + def initialize(source, node_id, location, flags, new_name, old_name, keyword_loc); 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#281 + # source://prism//lib/prism/node.rb#316 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#187 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#240 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#192 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#245 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#202 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#255 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#197 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#250 def compact_child_nodes; end - # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasGlobalVariableNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, ?old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode, ?keyword_loc: Location) -> AliasGlobalVariableNode # - # source://prism//lib/prism/node.rb#207 - 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 + # source://prism//lib/prism/node.rb#260 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#192 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#245 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode, keyword_loc: Location } # - # source://prism//lib/prism/node.rb#215 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#268 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -253,14 +235,13 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#247 + # source://prism//lib/prism/node.rb#300 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#242 - sig { returns(String) } + # source://prism//lib/prism/node.rb#295 def keyword; end # The location of the `alias` keyword. @@ -268,56 +249,35 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node # alias $foo $bar # ^^^^^ # - # source://prism//lib/prism/node.rb#235 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#288 def keyword_loc; end - # 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. + # Represents the new name of the global variable that can be used after aliasing. # # alias $foo $bar # ^^^^ # - # source://prism//lib/prism/node.rb#223 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#276 def new_name; end - # 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. + # Represents the old name of the global variable that can be used before aliasing. # # alias $foo $bar # ^^^^ # - # source://prism//lib/prism/node.rb#229 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#282 def old_name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#265 + # source://prism//lib/prism/node.rb#305 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#275 + # source://prism//lib/prism/node.rb#310 def type; end end end @@ -327,78 +287,55 @@ end # alias foo bar # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#293 +# source://prism//lib/prism/node.rb#328 class Prism::AliasMethodNode < ::Prism::Node - # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void + # Initialize a new AliasMethodNode node. # # @return [AliasMethodNode] a new instance of AliasMethodNode # - # source://prism//lib/prism/node.rb#295 - 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 + # source://prism//lib/prism/node.rb#330 + def initialize(source, node_id, location, flags, new_name, old_name, keyword_loc); 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#389 + # source://prism//lib/prism/node.rb#408 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#304 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#341 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#309 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#346 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#319 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#356 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#314 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#351 def compact_child_nodes; end - # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasMethodNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: SymbolNode | InterpolatedSymbolNode, ?old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode, ?keyword_loc: Location) -> AliasMethodNode # - # source://prism//lib/prism/node.rb#324 - 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 + # source://prism//lib/prism/node.rb#361 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#309 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#346 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, new_name: SymbolNode | InterpolatedSymbolNode, old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode, keyword_loc: Location } # - # source://prism//lib/prism/node.rb#332 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#369 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -406,62 +343,40 @@ class Prism::AliasMethodNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#355 + # source://prism//lib/prism/node.rb#392 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#350 - sig { returns(String) } + # source://prism//lib/prism/node.rb#387 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#343 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#380 def keyword_loc; end - # attr_reader new_name: Prism::node + # attr_reader new_name: SymbolNode | InterpolatedSymbolNode # - # source://prism//lib/prism/node.rb#337 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#374 def new_name; end - # attr_reader old_name: Prism::node + # attr_reader old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode # - # source://prism//lib/prism/node.rb#340 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#377 def old_name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#373 + # source://prism//lib/prism/node.rb#397 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#383 + # source://prism//lib/prism/node.rb#402 def type; end end end @@ -471,78 +386,55 @@ end # foo => bar | baz # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#401 +# source://prism//lib/prism/node.rb#420 class Prism::AlternationPatternNode < ::Prism::Node - # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void + # Initialize a new AlternationPatternNode node. # # @return [AlternationPatternNode] a new instance of AlternationPatternNode # - # source://prism//lib/prism/node.rb#403 - 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 + # source://prism//lib/prism/node.rb#422 + def initialize(source, node_id, location, flags, left, right, operator_loc); 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#497 + # source://prism//lib/prism/node.rb#500 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#412 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#433 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#417 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#438 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#427 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#448 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#422 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#443 def compact_child_nodes; end - # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AlternationPatternNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode # - # source://prism//lib/prism/node.rb#432 - 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 + # source://prism//lib/prism/node.rb#453 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#417 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#438 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#440 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#461 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -550,62 +442,40 @@ class Prism::AlternationPatternNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#463 + # source://prism//lib/prism/node.rb#484 sig { override.returns(String) } def inspect; end # attr_reader left: Prism::node # - # source://prism//lib/prism/node.rb#445 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#466 def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#458 - sig { returns(String) } + # source://prism//lib/prism/node.rb#479 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#451 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#472 def operator_loc; end # attr_reader right: Prism::node # - # source://prism//lib/prism/node.rb#448 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#469 def right; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#481 + # source://prism//lib/prism/node.rb#489 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#491 + # source://prism//lib/prism/node.rb#494 def type; end end end @@ -615,78 +485,55 @@ end # left and right # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#509 +# source://prism//lib/prism/node.rb#512 class Prism::AndNode < ::Prism::Node - # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void + # Initialize a new AndNode node. # # @return [AndNode] a new instance of AndNode # - # source://prism//lib/prism/node.rb#511 - 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 + # source://prism//lib/prism/node.rb#514 + def initialize(source, node_id, location, flags, left, right, operator_loc); 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#620 + # source://prism//lib/prism/node.rb#607 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#520 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#525 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#525 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#530 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#535 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#540 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#530 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#535 def compact_child_nodes; end - # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AndNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode # - # source://prism//lib/prism/node.rb#540 - 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 + # source://prism//lib/prism/node.rb#545 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#525 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#530 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#548 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#553 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -694,7 +541,7 @@ class Prism::AndNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#586 + # source://prism//lib/prism/node.rb#591 sig { override.returns(String) } def inspect; end @@ -706,14 +553,12 @@ class Prism::AndNode < ::Prism::Node # 1 && 2 # ^ # - # source://prism//lib/prism/node.rb#559 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#564 def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#581 - sig { returns(String) } + # source://prism//lib/prism/node.rb#586 def operator; end # The location of the `and` keyword or the `&&` operator. @@ -721,8 +566,7 @@ class Prism::AndNode < ::Prism::Node # left and right # ^^^ # - # source://prism//lib/prism/node.rb#574 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#579 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). @@ -733,38 +577,19 @@ class Prism::AndNode < ::Prism::Node # 1 and 2 # ^ # - # source://prism//lib/prism/node.rb#568 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#573 def right; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#604 + # source://prism//lib/prism/node.rb#596 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#614 + # source://prism//lib/prism/node.rb#601 def type; end end end @@ -774,56 +599,57 @@ end # return foo, bar, baz # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#632 +# source://prism//lib/prism/node.rb#619 class Prism::ArgumentsNode < ::Prism::Node - # def initialize: (Integer flags, Array[Prism::node] arguments, Location location) -> void + # Initialize a new ArgumentsNode node. # # @return [ArgumentsNode] a new instance of ArgumentsNode # - # source://prism//lib/prism/node.rb#634 + # source://prism//lib/prism/node.rb#621 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, - arguments: T::Array[Prism::Node], - location: Prism::Location + arguments: T::Array[Prism::Node] ).void end - def initialize(source, flags, arguments, location); end + def initialize(source, node_id, location, flags, arguments); 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#726 + # source://prism//lib/prism/node.rb#697 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#642 + # 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#679 + # source://prism//lib/prism/node.rb#678 sig { returns(T::Array[Prism::Node]) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#647 + # 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#657 + # 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#652 + # source://prism//lib/prism/node.rb#640 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end @@ -831,7 +657,7 @@ class Prism::ArgumentsNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#687 + # source://prism//lib/prism/node.rb#668 sig { returns(T::Boolean) } def contains_keyword_splat?; end @@ -839,32 +665,41 @@ class Prism::ArgumentsNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#682 + # source://prism//lib/prism/node.rb#663 sig { returns(T::Boolean) } def contains_keywords?; end - # def copy: (?flags: Integer, ?arguments: Array[Prism::node], ?location: Location) -> ArgumentsNode + # def contains_splat?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#673 + sig { returns(T::Boolean) } + def contains_splat?; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode # - # source://prism//lib/prism/node.rb#662 + # source://prism//lib/prism/node.rb#650 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, - arguments: T::Array[Prism::Node], - location: Prism::Location + arguments: T::Array[Prism::Node] ).returns(Prism::ArgumentsNode) end - def copy(flags: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#647 + # 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: Array[Prism::node] } # - # source://prism//lib/prism/node.rb#670 + # 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 @@ -873,110 +708,90 @@ class Prism::ArgumentsNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#692 + # source://prism//lib/prism/node.rb#681 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#710 + # source://prism//lib/prism/node.rb#686 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#675 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#720 + # source://prism//lib/prism/node.rb#691 def type; end end end # Flags for arguments nodes. # -# source://prism//lib/prism/node.rb#19127 +# source://prism//lib/prism/node.rb#16647 module Prism::ArgumentsNodeFlags; end # if arguments contain keywords # -# source://prism//lib/prism/node.rb#19129 +# source://prism//lib/prism/node.rb#16649 Prism::ArgumentsNodeFlags::CONTAINS_KEYWORDS = T.let(T.unsafe(nil), Integer) # if arguments contain keyword splat # -# source://prism//lib/prism/node.rb#19132 +# source://prism//lib/prism/node.rb#16652 Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT = T.let(T.unsafe(nil), Integer) +# if arguments contain splat +# +# source://prism//lib/prism/node.rb#16655 +Prism::ArgumentsNodeFlags::CONTAINS_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. # # [1, 2, 3] # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#738 +# source://prism//lib/prism/node.rb#709 class Prism::ArrayNode < ::Prism::Node - # def initialize: (Integer flags, Array[Prism::node] elements, Location? opening_loc, Location? closing_loc, Location location) -> void + # Initialize a new ArrayNode node. # # @return [ArrayNode] a new instance of ArrayNode # - # source://prism//lib/prism/node.rb#740 + # source://prism//lib/prism/node.rb#711 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, elements: T::Array[Prism::Node], opening_loc: T.nilable(Prism::Location), - closing_loc: T.nilable(Prism::Location), - location: Prism::Location + closing_loc: T.nilable(Prism::Location) ).void end - def initialize(source, flags, elements, opening_loc, closing_loc, location); end + def initialize(source, node_id, location, flags, elements, opening_loc, closing_loc); 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#875 + # source://prism//lib/prism/node.rb#825 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#750 + # source://prism//lib/prism/node.rb#722 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#755 + # source://prism//lib/prism/node.rb#727 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#836 + # source://prism//lib/prism/node.rb#804 sig { returns(T.nilable(String)) } def closing; end @@ -987,19 +802,19 @@ class Prism::ArrayNode < ::Prism::Node # %I(apple orange banana) # ")" # foo = 1, 2, 3 # nil # - # source://prism//lib/prism/node.rb#813 + # source://prism//lib/prism/node.rb#786 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#765 + # source://prism//lib/prism/node.rb#737 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#760 + # source://prism//lib/prism/node.rb#732 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end @@ -1007,40 +822,41 @@ class Prism::ArrayNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#826 + # source://prism//lib/prism/node.rb#755 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode # - # source://prism//lib/prism/node.rb#770 + # source://prism//lib/prism/node.rb#742 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, elements: T::Array[Prism::Node], opening_loc: T.nilable(Prism::Location), - closing_loc: T.nilable(Prism::Location), - location: Prism::Location + closing_loc: T.nilable(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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#755 + # source://prism//lib/prism/node.rb#727 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, elements: Array[Prism::node], opening_loc: Location?, closing_loc: Location? } # - # source://prism//lib/prism/node.rb#778 + # source://prism//lib/prism/node.rb#750 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array. # - # source://prism//lib/prism/node.rb#787 + # source://prism//lib/prism/node.rb#760 sig { returns(T::Array[Prism::Node]) } def elements; end @@ -1049,13 +865,13 @@ class Prism::ArrayNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#841 + # source://prism//lib/prism/node.rb#809 sig { override.returns(String) } def inspect; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#831 + # source://prism//lib/prism/node.rb#799 sig { returns(T.nilable(String)) } def opening; end @@ -1066,58 +882,32 @@ class Prism::ArrayNode < ::Prism::Node # %I(apple orange banana) # "%I(" # foo = 1, 2, 3 # nil # - # source://prism//lib/prism/node.rb#795 + # source://prism//lib/prism/node.rb#768 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#859 + # source://prism//lib/prism/node.rb#814 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#783 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#869 + # source://prism//lib/prism/node.rb#819 def type; end end end # Flags for array nodes. # -# source://prism//lib/prism/node.rb#19136 +# source://prism//lib/prism/node.rb#16659 module Prism::ArrayNodeFlags; end # if array contains splat nodes # -# source://prism//lib/prism/node.rb#19138 +# source://prism//lib/prism/node.rb#16661 Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) # Represents an array pattern in pattern matching. @@ -1137,102 +927,70 @@ Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) # foo in Bar[1, 2, 3] # ^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#901 +# source://prism//lib/prism/node.rb#851 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 + # Initialize a new ArrayPatternNode node. # # @return [ArrayPatternNode] a new instance of ArrayPatternNode # - # source://prism//lib/prism/node.rb#903 - 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 + # source://prism//lib/prism/node.rb#853 + def initialize(source, node_id, location, flags, constant, requireds, rest, posts, opening_loc, closing_loc); 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#1035 + # source://prism//lib/prism/node.rb#969 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#915 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#867 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#920 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#872 def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#996 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#948 def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#978 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#930 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#935 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#887 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#925 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#877 def compact_child_nodes; end # attr_reader constant: Prism::node? # - # source://prism//lib/prism/node.rb#953 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#905 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: Prism::node?, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode # - # source://prism//lib/prism/node.rb#940 - 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 + # source://prism//lib/prism/node.rb#892 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), requireds: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#920 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#872 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: Prism::node?, requireds: Array[Prism::node], rest: Prism::node?, posts: Array[Prism::node], opening_loc: Location?, closing_loc: Location? } # - # source://prism//lib/prism/node.rb#948 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#900 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -1240,68 +998,45 @@ class Prism::ArrayPatternNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1001 + # source://prism//lib/prism/node.rb#953 sig { override.returns(String) } def inspect; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#991 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#943 def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#965 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#917 def opening_loc; end # attr_reader posts: Array[Prism::node] # - # source://prism//lib/prism/node.rb#962 - sig { returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#914 def posts; end # attr_reader requireds: Array[Prism::node] # - # source://prism//lib/prism/node.rb#956 - sig { returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#908 def requireds; end # attr_reader rest: Prism::node? # - # source://prism//lib/prism/node.rb#959 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#911 def rest; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1019 + # source://prism//lib/prism/node.rb#958 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1029 + # source://prism//lib/prism/node.rb#963 def type; end end end @@ -1311,78 +1046,55 @@ end # { a => b } # ^^^^^^ # -# source://prism//lib/prism/node.rb#1052 +# source://prism//lib/prism/node.rb#986 class Prism::AssocNode < ::Prism::Node - # def initialize: (Prism::node key, Prism::node value, Location? operator_loc, Location location) -> void + # Initialize a new AssocNode node. # # @return [AssocNode] a new instance of AssocNode # - # source://prism//lib/prism/node.rb#1054 - 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 + # source://prism//lib/prism/node.rb#988 + def initialize(source, node_id, location, flags, key, value, operator_loc); 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#1172 + # source://prism//lib/prism/node.rb#1090 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1063 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#999 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1068 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1004 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1078 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#1014 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1073 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#1009 def compact_child_nodes; end - # def copy: (?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?, ?location: Location) -> AssocNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode # - # source://prism//lib/prism/node.rb#1083 - 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 + # source://prism//lib/prism/node.rb#1019 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1068 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1004 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { key: Prism::node, value: Prism::node, operator_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, key: Prism::node, value: Prism::node, operator_loc: Location? } # - # source://prism//lib/prism/node.rb#1091 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#1027 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -1390,7 +1102,7 @@ class Prism::AssocNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1138 + # source://prism//lib/prism/node.rb#1074 sig { override.returns(String) } def inspect; end @@ -1405,14 +1117,12 @@ class Prism::AssocNode < ::Prism::Node # { def a; end => 1 } # ^^^^^^^^^^ # - # source://prism//lib/prism/node.rb#1105 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#1041 def key; end # def operator: () -> String? # - # source://prism//lib/prism/node.rb#1133 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#1069 def operator; end # The location of the `=>` operator, if present. @@ -1420,26 +1130,12 @@ class Prism::AssocNode < ::Prism::Node # { foo => bar } # ^^ # - # source://prism//lib/prism/node.rb#1120 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#1056 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1156 + # source://prism//lib/prism/node.rb#1079 sig { override.returns(Symbol) } def type; end @@ -1451,19 +1147,13 @@ class Prism::AssocNode < ::Prism::Node # { x: 1 } # ^ # - # source://prism//lib/prism/node.rb#1114 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#1050 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#1166 + # source://prism//lib/prism/node.rb#1084 def type; end end end @@ -1473,76 +1163,55 @@ end # { **foo } # ^^^^^ # -# source://prism//lib/prism/node.rb#1184 +# source://prism//lib/prism/node.rb#1102 class Prism::AssocSplatNode < ::Prism::Node - # def initialize: (Prism::node? value, Location operator_loc, Location location) -> void + # Initialize a new AssocSplatNode node. # # @return [AssocSplatNode] a new instance of AssocSplatNode # - # source://prism//lib/prism/node.rb#1186 - 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 + # source://prism//lib/prism/node.rb#1104 + def initialize(source, node_id, location, flags, value, operator_loc); 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#1284 + # source://prism//lib/prism/node.rb#1186 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1194 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#1114 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1199 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1119 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1211 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#1131 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1204 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#1124 def compact_child_nodes; end - # def copy: (?value: Prism::node?, ?operator_loc: Location, ?location: Location) -> AssocSplatNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode # - # source://prism//lib/prism/node.rb#1216 - 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 + # source://prism//lib/prism/node.rb#1136 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1199 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1119 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node?, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node?, operator_loc: Location } # - # source://prism//lib/prism/node.rb#1224 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#1144 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -1550,14 +1219,13 @@ class Prism::AssocSplatNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1250 + # source://prism//lib/prism/node.rb#1170 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#1245 - sig { returns(String) } + # source://prism//lib/prism/node.rb#1165 def operator; end # The location of the `**` operator. @@ -1565,26 +1233,12 @@ class Prism::AssocSplatNode < ::Prism::Node # { **x } # ^^ # - # source://prism//lib/prism/node.rb#1238 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#1158 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#1268 + # source://prism//lib/prism/node.rb#1175 sig { override.returns(Symbol) } def type; end @@ -1593,19 +1247,13 @@ class Prism::AssocSplatNode < ::Prism::Node # { **foo } # ^^^ # - # source://prism//lib/prism/node.rb#1232 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#1152 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#1278 + # source://prism//lib/prism/node.rb#1180 def type; end end end @@ -1620,63 +1268,55 @@ Prism::BACKEND = T.let(T.unsafe(nil), Symbol) # $' # ^^ # -# source://prism//lib/prism/node.rb#1295 +# source://prism//lib/prism/node.rb#1197 class Prism::BackReferenceReadNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new BackReferenceReadNode node. # # @return [BackReferenceReadNode] a new instance of BackReferenceReadNode # - # source://prism//lib/prism/node.rb#1297 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#1199 + def initialize(source, node_id, location, flags, name); 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#1378 + # source://prism//lib/prism/node.rb#1264 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1304 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#1208 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1309 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1213 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1319 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#1223 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1314 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#1218 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> BackReferenceReadNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode # - # source://prism//lib/prism/node.rb#1324 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::BackReferenceReadNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#1228 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1309 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1213 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#1332 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#1236 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -1684,7 +1324,7 @@ class Prism::BackReferenceReadNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1344 + # source://prism//lib/prism/node.rb#1248 sig { override.returns(String) } def inspect; end @@ -1694,38 +1334,19 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # $+ # name `:$+` # - # source://prism//lib/prism/node.rb#1341 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#1245 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#1362 + # source://prism//lib/prism/node.rb#1253 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1372 + # source://prism//lib/prism/node.rb#1258 def type; end end end @@ -1764,120 +1385,85 @@ end # end # ^^^^^ # -# source://prism//lib/prism/node.rb#1390 +# source://prism//lib/prism/node.rb#1276 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 + # Initialize a new BeginNode node. # # @return [BeginNode] a new instance of BeginNode # - # source://prism//lib/prism/node.rb#1392 - 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 + # source://prism//lib/prism/node.rb#1278 + def initialize(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc); 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#1524 + # source://prism//lib/prism/node.rb#1394 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1404 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#1292 def accept(visitor); end # def begin_keyword: () -> String? # - # source://prism//lib/prism/node.rb#1480 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#1368 def begin_keyword; end # attr_reader begin_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#1442 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#1330 def begin_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1409 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1297 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1424 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#1312 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1414 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#1302 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode # - # source://prism//lib/prism/node.rb#1429 - 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 + # source://prism//lib/prism/node.rb#1317 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), begin_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), rescue_clause: T.unsafe(nil), else_clause: T.unsafe(nil), ensure_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1409 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1297 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location? } # - # source://prism//lib/prism/node.rb#1437 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#1325 def deconstruct_keys(keys); end # attr_reader else_clause: ElseNode? # - # source://prism//lib/prism/node.rb#1461 - sig { returns(T.nilable(Prism::ElseNode)) } + # source://prism//lib/prism/node.rb#1349 def else_clause; end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#1485 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#1373 def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#1467 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#1355 def end_keyword_loc; end # attr_reader ensure_clause: EnsureNode? # - # source://prism//lib/prism/node.rb#1464 - sig { returns(T.nilable(Prism::EnsureNode)) } + # source://prism//lib/prism/node.rb#1352 def ensure_clause; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -1885,138 +1471,96 @@ class Prism::BeginNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1490 + # source://prism//lib/prism/node.rb#1378 sig { override.returns(String) } def inspect; end # source://prism//lib/prism/parse_result/newlines.rb#79 - def newline!(lines); end + def newline_flag!(lines); end # attr_reader rescue_clause: RescueNode? # - # source://prism//lib/prism/node.rb#1458 - sig { returns(T.nilable(Prism::RescueNode)) } + # source://prism//lib/prism/node.rb#1346 def rescue_clause; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#1455 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#1343 def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#1508 + # source://prism//lib/prism/node.rb#1383 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1518 + # source://prism//lib/prism/node.rb#1388 def type; end end end -# Represents block method arguments. +# Represents a block argument using `&`. # # bar(&args) # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#1539 +# source://prism//lib/prism/node.rb#1409 class Prism::BlockArgumentNode < ::Prism::Node - # def initialize: (Prism::node? expression, Location operator_loc, Location location) -> void + # Initialize a new BlockArgumentNode node. # # @return [BlockArgumentNode] a new instance of BlockArgumentNode # - # source://prism//lib/prism/node.rb#1541 - 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 + # source://prism//lib/prism/node.rb#1411 + def initialize(source, node_id, location, flags, expression, operator_loc); 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#1633 + # source://prism//lib/prism/node.rb#1487 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1549 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#1421 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1554 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1426 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1566 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#1438 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1559 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#1431 def compact_child_nodes; end - # def copy: (?expression: Prism::node?, ?operator_loc: Location, ?location: Location) -> BlockArgumentNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode # - # source://prism//lib/prism/node.rb#1571 - 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 + # source://prism//lib/prism/node.rb#1443 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1554 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1426 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node?, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node?, operator_loc: Location } # - # source://prism//lib/prism/node.rb#1579 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#1451 def deconstruct_keys(keys); end # attr_reader expression: Prism::node? # - # source://prism//lib/prism/node.rb#1584 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#1456 def expression; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -2024,50 +1568,30 @@ class Prism::BlockArgumentNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1599 + # source://prism//lib/prism/node.rb#1471 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#1594 - sig { returns(String) } + # source://prism//lib/prism/node.rb#1466 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#1587 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#1459 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#1617 + # source://prism//lib/prism/node.rb#1476 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1627 + # source://prism//lib/prism/node.rb#1481 def type; end end end @@ -2077,62 +1601,69 @@ end # a { |; b| } # ^ # -# source://prism//lib/prism/node.rb#1644 +# source://prism//lib/prism/node.rb#1498 class Prism::BlockLocalVariableNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location location) -> void + # Initialize a new BlockLocalVariableNode node. # # @return [BlockLocalVariableNode] a new instance of BlockLocalVariableNode # - # source://prism//lib/prism/node.rb#1646 - sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void } - def initialize(source, flags, name, location); end + # source://prism//lib/prism/node.rb#1500 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); 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#1733 + # source://prism//lib/prism/node.rb#1566 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1654 + # source://prism//lib/prism/node.rb#1509 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#1659 + # source://prism//lib/prism/node.rb#1514 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#1669 + # source://prism//lib/prism/node.rb#1524 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#1664 + # source://prism//lib/prism/node.rb#1519 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> BlockLocalVariableNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode # - # source://prism//lib/prism/node.rb#1674 - 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 + # source://prism//lib/prism/node.rb#1529 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::BlockLocalVariableNode) + end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1659 + # source://prism//lib/prism/node.rb#1514 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#1682 + # source://prism//lib/prism/node.rb#1537 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -2141,13 +1672,13 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1699 + # source://prism//lib/prism/node.rb#1550 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#1691 + # source://prism//lib/prism/node.rb#1547 sig { returns(Symbol) } def name; end @@ -2155,46 +1686,20 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#1694 + # source://prism//lib/prism/node.rb#1542 sig { returns(T::Boolean) } def repeated_parameter?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#1717 + # source://prism//lib/prism/node.rb#1555 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#1687 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1727 + # source://prism//lib/prism/node.rb#1560 def type; end end end @@ -2204,100 +1709,70 @@ end # [1, 2, 3].each { |i| puts x } # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#1744 +# source://prism//lib/prism/node.rb#1577 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 + # Initialize a new BlockNode node. # # @return [BlockNode] a new instance of BlockNode # - # source://prism//lib/prism/node.rb#1746 - 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 + # source://prism//lib/prism/node.rb#1579 + def initialize(source, node_id, location, flags, locals, parameters, body, opening_loc, closing_loc); 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#1860 + # source://prism//lib/prism/node.rb#1677 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1757 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#1592 def accept(visitor); end - # attr_reader body: Prism::node? + # attr_reader body: StatementsNode | BeginNode | nil # - # source://prism//lib/prism/node.rb#1799 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#1634 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1762 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1597 def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#1821 - sig { returns(String) } + # source://prism//lib/prism/node.rb#1656 def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#1809 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#1644 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1775 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#1610 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1767 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#1602 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, ?body: StatementsNode | BeginNode | nil, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode # - # source://prism//lib/prism/node.rb#1780 - 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 + # source://prism//lib/prism/node.rb#1615 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1762 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1597 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, body: StatementsNode | BeginNode | nil, opening_loc: Location, closing_loc: Location } # - # source://prism//lib/prism/node.rb#1788 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#1623 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -2305,145 +1780,125 @@ class Prism::BlockNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1826 + # source://prism//lib/prism/node.rb#1661 sig { override.returns(String) } def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#1793 - sig { returns(T::Array[Symbol]) } + # source://prism//lib/prism/node.rb#1628 def locals; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#1816 - sig { returns(String) } + # source://prism//lib/prism/node.rb#1651 def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#1802 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#1637 def opening_loc; end - # attr_reader parameters: Prism::node? + # attr_reader parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil # - # source://prism//lib/prism/node.rb#1796 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#1631 def parameters; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1844 + # source://prism//lib/prism/node.rb#1666 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#1854 + # source://prism//lib/prism/node.rb#1671 def type; end end end -# Represents a block parameter to a method, block, or lambda definition. +# Represents a block parameter of a method, block, or lambda definition. # # def a(&b) # ^^ # end # -# source://prism//lib/prism/node.rb#1876 +# source://prism//lib/prism/node.rb#1693 class Prism::BlockParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void + # Initialize a new BlockParameterNode node. # # @return [BlockParameterNode] a new instance of BlockParameterNode # - # source://prism//lib/prism/node.rb#1878 + # source://prism//lib/prism/node.rb#1695 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: Prism::Location ).void end - def initialize(source, flags, name, name_loc, operator_loc, location); end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc); 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#1992 + # source://prism//lib/prism/node.rb#1788 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1888 + # source://prism//lib/prism/node.rb#1706 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#1893 + # source://prism//lib/prism/node.rb#1711 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#1903 + # source://prism//lib/prism/node.rb#1721 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#1898 + # source://prism//lib/prism/node.rb#1716 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode # - # source://prism//lib/prism/node.rb#1908 + # source://prism//lib/prism/node.rb#1726 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1893 + # source://prism//lib/prism/node.rb#1711 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location } # - # source://prism//lib/prism/node.rb#1916 + # source://prism//lib/prism/node.rb#1734 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -2452,31 +1907,31 @@ class Prism::BlockParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#1958 + # source://prism//lib/prism/node.rb#1772 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol? # - # source://prism//lib/prism/node.rb#1925 + # source://prism//lib/prism/node.rb#1744 sig { returns(T.nilable(Symbol)) } def name; end # attr_reader name_loc: Location? # - # source://prism//lib/prism/node.rb#1928 + # source://prism//lib/prism/node.rb#1747 sig { returns(T.nilable(Prism::Location)) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#1953 + # source://prism//lib/prism/node.rb#1767 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#1941 + # source://prism//lib/prism/node.rb#1760 sig { returns(Prism::Location) } def operator_loc; end @@ -2484,46 +1939,20 @@ class Prism::BlockParameterNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#1948 + # source://prism//lib/prism/node.rb#1739 sig { returns(T::Boolean) } def repeated_parameter?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#1976 + # source://prism//lib/prism/node.rb#1777 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#1921 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#1986 + # source://prism//lib/prism/node.rb#1782 def type; end end end @@ -2537,92 +1966,65 @@ end # ^^^^^^^^^^^^^^^^^ # end # -# source://prism//lib/prism/node.rb#2009 +# source://prism//lib/prism/node.rb#1805 class Prism::BlockParametersNode < ::Prism::Node - # def initialize: (ParametersNode? parameters, Array[BlockLocalVariableNode] locals, Location? opening_loc, Location? closing_loc, Location location) -> void + # Initialize a new BlockParametersNode node. # # @return [BlockParametersNode] a new instance of BlockParametersNode # - # source://prism//lib/prism/node.rb#2011 - 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 + # source://prism//lib/prism/node.rb#1807 + def initialize(source, node_id, location, flags, parameters, locals, opening_loc, closing_loc); 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#2133 + # source://prism//lib/prism/node.rb#1913 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2021 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#1819 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2026 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1824 def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#2094 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#1892 def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#2076 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#1874 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#2039 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#1837 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#2031 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#1829 def compact_child_nodes; end - # def copy: (?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> BlockParametersNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode # - # source://prism//lib/prism/node.rb#2044 - 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 + # source://prism//lib/prism/node.rb#1842 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2026 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1824 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location? } # - # source://prism//lib/prism/node.rb#2052 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#1850 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -2630,62 +2032,40 @@ class Prism::BlockParametersNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#2099 + # source://prism//lib/prism/node.rb#1897 sig { override.returns(String) } def inspect; end # attr_reader locals: Array[BlockLocalVariableNode] # - # source://prism//lib/prism/node.rb#2060 - sig { returns(T::Array[Prism::BlockLocalVariableNode]) } + # source://prism//lib/prism/node.rb#1858 def locals; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#2089 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#1887 def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#2063 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#1861 def opening_loc; end # attr_reader parameters: ParametersNode? # - # source://prism//lib/prism/node.rb#2057 - sig { returns(T.nilable(Prism::ParametersNode)) } + # source://prism//lib/prism/node.rb#1855 def parameters; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#2117 + # source://prism//lib/prism/node.rb#1902 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#2127 + # source://prism//lib/prism/node.rb#1907 def type; end end end @@ -2695,33 +2075,24 @@ end # break foo # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#2147 +# source://prism//lib/prism/node.rb#1927 class Prism::BreakNode < ::Prism::Node - # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void + # Initialize a new BreakNode node. # # @return [BreakNode] a new instance of BreakNode # - # source://prism//lib/prism/node.rb#2149 - 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 + # source://prism//lib/prism/node.rb#1929 + def initialize(source, node_id, location, flags, arguments, keyword_loc); 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#2247 + # source://prism//lib/prism/node.rb#2011 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2157 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#1939 def accept(visitor); end # The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). @@ -2729,51 +2100,38 @@ class Prism::BreakNode < ::Prism::Node # break foo # ^^^ # - # source://prism//lib/prism/node.rb#2195 - sig { returns(T.nilable(Prism::ArgumentsNode)) } + # source://prism//lib/prism/node.rb#1977 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2162 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1944 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#2174 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#1956 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#2167 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#1949 def compact_child_nodes; end - # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> BreakNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode # - # source://prism//lib/prism/node.rb#2179 - 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 + # source://prism//lib/prism/node.rb#1961 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2162 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#1944 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: ArgumentsNode?, keyword_loc: Location } # - # source://prism//lib/prism/node.rb#2187 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#1969 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -2781,14 +2139,13 @@ class Prism::BreakNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#2213 + # source://prism//lib/prism/node.rb#1995 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#2208 - sig { returns(String) } + # source://prism//lib/prism/node.rb#1990 def keyword; end # The location of the `break` keyword. @@ -2796,38 +2153,19 @@ class Prism::BreakNode < ::Prism::Node # break foo # ^^^^^ # - # source://prism//lib/prism/node.rb#2201 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#1983 def keyword_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#2231 + # source://prism//lib/prism/node.rb#2000 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#2241 + # source://prism//lib/prism/node.rb#2005 def type; end end end @@ -2837,16 +2175,18 @@ end # foo.bar &&= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#2258 +# source://prism//lib/prism/node.rb#2022 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 + # Initialize a new CallAndWriteNode node. # # @return [CallAndWriteNode] a new instance of CallAndWriteNode # - # source://prism//lib/prism/node.rb#2260 + # source://prism//lib/prism/node.rb#2024 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -2854,21 +2194,20 @@ class Prism::CallAndWriteNode < ::Prism::Node read_name: Symbol, write_name: Symbol, operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).void end - def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value); 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#2428 + # source://prism//lib/prism/node.rb#2171 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2274 + # source://prism//lib/prism/node.rb#2039 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -2876,45 +2215,47 @@ class Prism::CallAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2369 + # source://prism//lib/prism/node.rb#2085 sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#2379 + # source://prism//lib/prism/node.rb#2140 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#2317 + # source://prism//lib/prism/node.rb#2098 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2279 + # source://prism//lib/prism/node.rb#2044 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#2292 + # source://prism//lib/prism/node.rb#2057 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#2284 + # source://prism//lib/prism/node.rb#2049 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode # - # source://prism//lib/prism/node.rb#2297 + # source://prism//lib/prism/node.rb#2062 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -2922,22 +2263,21 @@ class Prism::CallAndWriteNode < ::Prism::Node read_name: Symbol, write_name: Symbol, operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2279 + # source://prism//lib/prism/node.rb#2044 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#2305 + # source://prism//lib/prism/node.rb#2070 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -2948,49 +2288,49 @@ class Prism::CallAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2374 + # source://prism//lib/prism/node.rb#2090 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#2394 + # source://prism//lib/prism/node.rb#2155 sig { override.returns(String) } def inspect; end # def message: () -> String? # - # source://prism//lib/prism/node.rb#2384 + # source://prism//lib/prism/node.rb#2145 sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//lib/prism/node.rb#2330 + # source://prism//lib/prism/node.rb#2111 sig { returns(T.nilable(Prism::Location)) } def message_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#2389 + # source://prism//lib/prism/node.rb#2150 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#2349 + # source://prism//lib/prism/node.rb#2130 sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//lib/prism/node.rb#2343 + # source://prism//lib/prism/node.rb#2124 sig { returns(Symbol) } def read_name; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#2314 + # source://prism//lib/prism/node.rb#2095 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -2998,32 +2338,19 @@ class Prism::CallAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2359 + # source://prism//lib/prism/node.rb#2075 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#2412 + # source://prism//lib/prism/node.rb#2160 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#2356 + # source://prism//lib/prism/node.rb#2137 sig { returns(Prism::Node) } def value; end @@ -3031,33 +2358,20 @@ class Prism::CallAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2364 + # source://prism//lib/prism/node.rb#2080 sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//lib/prism/node.rb#2346 + # source://prism//lib/prism/node.rb#2127 sig { returns(Symbol) } def write_name; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#2310 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#2422 + # source://prism//lib/prism/node.rb#2165 def type; end end end @@ -3082,16 +2396,18 @@ end # foo&.bar # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#2460 +# source://prism//lib/prism/node.rb#2203 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 + # Initialize a new CallNode node. # # @return [CallNode] a new instance of CallNode # - # source://prism//lib/prism/node.rb#2462 + # source://prism//lib/prism/node.rb#2205 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -3100,27 +2416,26 @@ class Prism::CallNode < ::Prism::Node 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 + block: T.nilable(Prism::Node) ).void end - def initialize(source, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location); end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block); 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#2665 + # source://prism//lib/prism/node.rb#2387 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2477 + # source://prism//lib/prism/node.rb#2221 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#2572 + # source://prism//lib/prism/node.rb#2332 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -3128,63 +2443,65 @@ class Prism::CallNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2601 + # source://prism//lib/prism/node.rb#2268 sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#2588 + # source://prism//lib/prism/node.rb#2348 sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#2611 + # source://prism//lib/prism/node.rb#2351 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#2530 + # source://prism//lib/prism/node.rb#2290 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2482 + # source://prism//lib/prism/node.rb#2226 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#2626 + # source://prism//lib/prism/node.rb#2366 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#2575 + # source://prism//lib/prism/node.rb#2335 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#2496 + # source://prism//lib/prism/node.rb#2240 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#2487 + # source://prism//lib/prism/node.rb#2231 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?block: Prism::node?) -> CallNode # - # source://prism//lib/prism/node.rb#2501 + # source://prism//lib/prism/node.rb#2245 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -3193,22 +2510,21 @@ class Prism::CallNode < ::Prism::Node 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 + block: T.nilable(Prism::Node) ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2482 + # source://prism//lib/prism/node.rb#2226 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Prism::node? } # - # source://prism//lib/prism/node.rb#2509 + # source://prism//lib/prism/node.rb#2253 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -3225,7 +2541,7 @@ class Prism::CallNode < ::Prism::Node # sometimes you want the location of the full message including the inner # space and the = sign. This method provides that. # - # source://prism//lib/prism/node_ext.rb#315 + # source://prism//lib/prism/node_ext.rb#331 sig { returns(T.nilable(Prism::Location)) } def full_message_loc; end @@ -3233,43 +2549,43 @@ class Prism::CallNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2606 + # source://prism//lib/prism/node.rb#2273 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#2631 + # source://prism//lib/prism/node.rb#2371 sig { override.returns(String) } def inspect; end # def message: () -> String? # - # source://prism//lib/prism/node.rb#2616 + # source://prism//lib/prism/node.rb#2356 sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//lib/prism/node.rb#2546 + # source://prism//lib/prism/node.rb#2306 sig { returns(T.nilable(Prism::Location)) } def message_loc; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#2543 + # source://prism//lib/prism/node.rb#2303 sig { returns(Symbol) } def name; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#2621 + # source://prism//lib/prism/node.rb#2361 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#2559 + # source://prism//lib/prism/node.rb#2319 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end @@ -3284,7 +2600,7 @@ class Prism::CallNode < ::Prism::Node # foo + bar # ^^^ # - # source://prism//lib/prism/node.rb#2527 + # source://prism//lib/prism/node.rb#2287 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -3292,26 +2608,13 @@ class Prism::CallNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2591 + # source://prism//lib/prism/node.rb#2258 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#2649 + # source://prism//lib/prism/node.rb#2376 sig { override.returns(Symbol) } def type; end @@ -3319,54 +2622,41 @@ class Prism::CallNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2596 + # source://prism//lib/prism/node.rb#2263 sig { returns(T::Boolean) } def variable_call?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#2514 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#2659 + # source://prism//lib/prism/node.rb#2381 def type; end end end # Flags for call nodes. # -# source://prism//lib/prism/node.rb#19142 +# source://prism//lib/prism/node.rb#16665 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#19150 +# source://prism//lib/prism/node.rb#16673 Prism::CallNodeFlags::ATTRIBUTE_WRITE = T.let(T.unsafe(nil), Integer) # a call that ignores method visibility # -# source://prism//lib/prism/node.rb#19153 +# source://prism//lib/prism/node.rb#16676 Prism::CallNodeFlags::IGNORE_VISIBILITY = T.let(T.unsafe(nil), Integer) # &. operator # -# source://prism//lib/prism/node.rb#19144 +# source://prism//lib/prism/node.rb#16667 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#19147 +# source://prism//lib/prism/node.rb#16670 Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) # Represents the use of an assignment operator on a call. @@ -3374,16 +2664,18 @@ Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) # foo.bar += baz # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#2683 +# source://prism//lib/prism/node.rb#2405 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 binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void + # Initialize a new CallOperatorWriteNode node. # # @return [CallOperatorWriteNode] a new instance of CallOperatorWriteNode # - # source://prism//lib/prism/node.rb#2685 + # source://prism//lib/prism/node.rb#2407 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -3392,21 +2684,20 @@ class Prism::CallOperatorWriteNode < ::Prism::Node write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).void end - def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, location); end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value); 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#2852 + # source://prism//lib/prism/node.rb#2553 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2700 + # source://prism//lib/prism/node.rb#2423 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -3414,57 +2705,59 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2798 + # source://prism//lib/prism/node.rb#2469 sig { returns(T::Boolean) } def attribute_write?; end # attr_reader binary_operator: Symbol # - # source://prism//lib/prism/node.rb#2775 + # source://prism//lib/prism/node.rb#2514 sig { returns(Symbol) } def binary_operator; end # attr_reader binary_operator_loc: Location # - # source://prism//lib/prism/node.rb#2778 + # source://prism//lib/prism/node.rb#2517 sig { returns(Prism::Location) } def binary_operator_loc; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#2808 + # source://prism//lib/prism/node.rb#2527 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#2743 + # source://prism//lib/prism/node.rb#2482 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2705 + # source://prism//lib/prism/node.rb#2428 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#2718 + # source://prism//lib/prism/node.rb#2441 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#2710 + # source://prism//lib/prism/node.rb#2433 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, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOperatorWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode # - # source://prism//lib/prism/node.rb#2723 + # source://prism//lib/prism/node.rb#2446 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -3473,22 +2766,21 @@ class Prism::CallOperatorWriteNode < ::Prism::Node write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).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), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2705 + # source://prism//lib/prism/node.rb#2428 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, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#2731 + # source://prism//lib/prism/node.rb#2454 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -3499,49 +2791,49 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2803 + # source://prism//lib/prism/node.rb#2474 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#2818 + # source://prism//lib/prism/node.rb#2537 sig { override.returns(String) } def inspect; end # def message: () -> String? # - # source://prism//lib/prism/node.rb#2813 + # source://prism//lib/prism/node.rb#2532 sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//lib/prism/node.rb#2756 + # source://prism//lib/prism/node.rb#2495 sig { returns(T.nilable(Prism::Location)) } def message_loc; end # Returns the binary operator used to modify the receiver. This method is # deprecated in favor of #binary_operator. # - # source://prism//lib/prism/node_ext.rb#323 + # source://prism//lib/prism/node_ext.rb#339 def operator; end # Returns the location of the binary operator used to modify the receiver. # This method is deprecated in favor of #binary_operator_loc. # - # source://prism//lib/prism/node_ext.rb#330 + # source://prism//lib/prism/node_ext.rb#346 def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//lib/prism/node.rb#2769 + # source://prism//lib/prism/node.rb#2508 sig { returns(Symbol) } def read_name; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#2740 + # source://prism//lib/prism/node.rb#2479 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -3549,32 +2841,19 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2788 + # source://prism//lib/prism/node.rb#2459 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#2836 + # source://prism//lib/prism/node.rb#2542 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#2785 + # source://prism//lib/prism/node.rb#2524 sig { returns(Prism::Node) } def value; end @@ -3582,33 +2861,20 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2793 + # source://prism//lib/prism/node.rb#2464 sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//lib/prism/node.rb#2772 + # source://prism//lib/prism/node.rb#2511 sig { returns(Symbol) } def write_name; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#2736 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#2846 + # source://prism//lib/prism/node.rb#2547 def type; end end end @@ -3618,16 +2884,18 @@ end # foo.bar ||= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#2870 +# source://prism//lib/prism/node.rb#2571 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 + # Initialize a new CallOrWriteNode node. # # @return [CallOrWriteNode] a new instance of CallOrWriteNode # - # source://prism//lib/prism/node.rb#2872 + # source://prism//lib/prism/node.rb#2573 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -3635,21 +2903,20 @@ class Prism::CallOrWriteNode < ::Prism::Node read_name: Symbol, write_name: Symbol, operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).void end - def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value); 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#3040 + # source://prism//lib/prism/node.rb#2720 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2886 + # source://prism//lib/prism/node.rb#2588 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -3657,45 +2924,47 @@ class Prism::CallOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2981 + # source://prism//lib/prism/node.rb#2634 sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#2991 + # source://prism//lib/prism/node.rb#2689 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#2929 + # source://prism//lib/prism/node.rb#2647 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2891 + # source://prism//lib/prism/node.rb#2593 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#2904 + # source://prism//lib/prism/node.rb#2606 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#2896 + # source://prism//lib/prism/node.rb#2598 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode # - # source://prism//lib/prism/node.rb#2909 + # source://prism//lib/prism/node.rb#2611 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -3703,22 +2972,21 @@ class Prism::CallOrWriteNode < ::Prism::Node read_name: Symbol, write_name: Symbol, operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2891 + # source://prism//lib/prism/node.rb#2593 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#2917 + # source://prism//lib/prism/node.rb#2619 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -3729,49 +2997,49 @@ class Prism::CallOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2986 + # source://prism//lib/prism/node.rb#2639 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#3006 + # source://prism//lib/prism/node.rb#2704 sig { override.returns(String) } def inspect; end # def message: () -> String? # - # source://prism//lib/prism/node.rb#2996 + # source://prism//lib/prism/node.rb#2694 sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//lib/prism/node.rb#2942 + # source://prism//lib/prism/node.rb#2660 sig { returns(T.nilable(Prism::Location)) } def message_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#3001 + # source://prism//lib/prism/node.rb#2699 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#2961 + # source://prism//lib/prism/node.rb#2679 sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//lib/prism/node.rb#2955 + # source://prism//lib/prism/node.rb#2673 sig { returns(Symbol) } def read_name; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#2926 + # source://prism//lib/prism/node.rb#2644 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -3779,32 +3047,19 @@ class Prism::CallOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2971 + # source://prism//lib/prism/node.rb#2624 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3024 + # source://prism//lib/prism/node.rb#2709 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#2968 + # source://prism//lib/prism/node.rb#2686 sig { returns(Prism::Node) } def value; end @@ -3812,33 +3067,20 @@ class Prism::CallOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2976 + # source://prism//lib/prism/node.rb#2629 sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//lib/prism/node.rb#2958 + # source://prism//lib/prism/node.rb#2676 sig { returns(Symbol) } def write_name; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#2922 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#3034 + # source://prism//lib/prism/node.rb#2714 def type; end end end @@ -3856,35 +3098,36 @@ end # for foo.bar in baz do end # ^^^^^^^ # -# source://prism//lib/prism/node.rb#3065 +# source://prism//lib/prism/node.rb#2745 class Prism::CallTargetNode < ::Prism::Node - # def initialize: (Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc, Location location) -> void + # Initialize a new CallTargetNode node. # # @return [CallTargetNode] a new instance of CallTargetNode # - # source://prism//lib/prism/node.rb#3067 + # source://prism//lib/prism/node.rb#2747 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: Prism::Node, call_operator_loc: Prism::Location, name: Symbol, - message_loc: Prism::Location, - location: Prism::Location + message_loc: Prism::Location ).void end - def initialize(source, flags, receiver, call_operator_loc, name, message_loc, location); end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc); 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#3199 + # source://prism//lib/prism/node.rb#2858 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3078 + # source://prism//lib/prism/node.rb#2759 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -3892,65 +3135,66 @@ class Prism::CallTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#3145 + # source://prism//lib/prism/node.rb#2802 sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String # - # source://prism//lib/prism/node.rb#3155 + # source://prism//lib/prism/node.rb#2832 sig { returns(String) } def call_operator; end # attr_reader call_operator_loc: Location # - # source://prism//lib/prism/node.rb#3118 + # source://prism//lib/prism/node.rb#2815 sig { returns(Prism::Location) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3083 + # source://prism//lib/prism/node.rb#2764 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#3093 + # source://prism//lib/prism/node.rb#2774 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#3088 + # source://prism//lib/prism/node.rb#2769 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode # - # source://prism//lib/prism/node.rb#3098 + # source://prism//lib/prism/node.rb#2779 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: Prism::Node, call_operator_loc: Prism::Location, name: Symbol, - message_loc: Prism::Location, - location: Prism::Location + message_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3083 + # source://prism//lib/prism/node.rb#2764 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node, call_operator_loc: Location, name: Symbol, message_loc: Location } # - # source://prism//lib/prism/node.rb#3106 + # source://prism//lib/prism/node.rb#2787 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -3961,37 +3205,37 @@ class Prism::CallTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#3150 + # source://prism//lib/prism/node.rb#2807 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#3165 + # source://prism//lib/prism/node.rb#2842 sig { override.returns(String) } def inspect; end # def message: () -> String # - # source://prism//lib/prism/node.rb#3160 + # source://prism//lib/prism/node.rb#2837 sig { returns(String) } def message; end # attr_reader message_loc: Location # - # source://prism//lib/prism/node.rb#3128 + # source://prism//lib/prism/node.rb#2825 sig { returns(Prism::Location) } def message_loc; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#3125 + # source://prism//lib/prism/node.rb#2822 sig { returns(Symbol) } def name; end # attr_reader receiver: Prism::node # - # source://prism//lib/prism/node.rb#3115 + # source://prism//lib/prism/node.rb#2812 sig { returns(Prism::Node) } def receiver; end @@ -3999,26 +3243,13 @@ class Prism::CallTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#3135 + # source://prism//lib/prism/node.rb#2792 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3183 + # source://prism//lib/prism/node.rb#2847 sig { override.returns(Symbol) } def type; end @@ -4026,27 +3257,14 @@ class Prism::CallTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#3140 + # source://prism//lib/prism/node.rb#2797 sig { returns(T::Boolean) } def variable_call?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#3111 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#3193 + # source://prism//lib/prism/node.rb#2852 def type; end end end @@ -4056,78 +3274,55 @@ end # foo => [bar => baz] # ^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3213 +# source://prism//lib/prism/node.rb#2872 class Prism::CapturePatternNode < ::Prism::Node - # def initialize: (Prism::node value, Prism::node target, Location operator_loc, Location location) -> void + # Initialize a new CapturePatternNode node. # # @return [CapturePatternNode] a new instance of CapturePatternNode # - # source://prism//lib/prism/node.rb#3215 - 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 + # source://prism//lib/prism/node.rb#2874 + def initialize(source, node_id, location, flags, value, target, operator_loc); 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#3309 + # source://prism//lib/prism/node.rb#2952 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3224 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#2885 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3229 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#2890 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3239 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#2900 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3234 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#2895 def compact_child_nodes; end - # def copy: (?value: Prism::node, ?target: Prism::node, ?operator_loc: Location, ?location: Location) -> CapturePatternNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: Prism::node, ?operator_loc: Location) -> CapturePatternNode # - # source://prism//lib/prism/node.rb#3244 - 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 + # source://prism//lib/prism/node.rb#2905 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3229 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#2890 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, target: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, target: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#3252 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#2913 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -4135,62 +3330,40 @@ class Prism::CapturePatternNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#3275 + # source://prism//lib/prism/node.rb#2936 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#3270 - sig { returns(String) } + # source://prism//lib/prism/node.rb#2931 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#3263 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#2924 def operator_loc; end # attr_reader target: Prism::node # - # source://prism//lib/prism/node.rb#3260 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#2921 def target; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3293 + # source://prism//lib/prism/node.rb#2941 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#3257 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#2918 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3303 + # source://prism//lib/prism/node.rb#2946 def type; end end end @@ -4202,118 +3375,91 @@ end # end # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3323 +# source://prism//lib/prism/node.rb#2966 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 + # Initialize a new CaseMatchNode node. # # @return [CaseMatchNode] a new instance of CaseMatchNode # - # source://prism//lib/prism/node.rb#3325 - 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 + # source://prism//lib/prism/node.rb#2968 + def initialize(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc); 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#3440 + # source://prism//lib/prism/node.rb#3067 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3336 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#2981 def accept(visitor); end # def case_keyword: () -> String # - # source://prism//lib/prism/node.rb#3396 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3041 def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3382 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3027 def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3341 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#2986 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3355 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3000 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3346 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#2991 def compact_child_nodes; end # attr_reader conditions: Array[Prism::node] # - # source://prism//lib/prism/node.rb#3376 - sig { returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3021 def conditions; end - # attr_reader consequent: ElseNode? + # Returns the else clause of the case match node. This method is deprecated + # in favor of #else_clause. # - # source://prism//lib/prism/node.rb#3379 - sig { returns(T.nilable(Prism::ElseNode)) } + # source://prism//lib/prism/node_ext.rb#467 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[Prism::node], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode # - # source://prism//lib/prism/node.rb#3360 - 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 + # source://prism//lib/prism/node.rb#3005 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3341 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#2986 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, predicate: Prism::node?, conditions: Array[Prism::node], else_clause: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location } # - # source://prism//lib/prism/node.rb#3368 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3013 def deconstruct_keys(keys); end + # attr_reader else_clause: ElseNode? + # + # source://prism//lib/prism/node.rb#3024 + def else_clause; end + # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#3401 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3046 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3389 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3034 def end_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -4321,44 +3467,25 @@ class Prism::CaseMatchNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#3406 + # source://prism//lib/prism/node.rb#3051 sig { override.returns(String) } def inspect; end # attr_reader predicate: Prism::node? # - # source://prism//lib/prism/node.rb#3373 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#3018 def predicate; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#3424 + # source://prism//lib/prism/node.rb#3056 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3434 + # source://prism//lib/prism/node.rb#3061 def type; end end end @@ -4370,118 +3497,91 @@ end # end # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3457 +# source://prism//lib/prism/node.rb#3084 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 + # Initialize a new CaseNode node. # # @return [CaseNode] a new instance of CaseNode # - # source://prism//lib/prism/node.rb#3459 - 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 + # source://prism//lib/prism/node.rb#3086 + def initialize(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc); 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#3574 + # source://prism//lib/prism/node.rb#3185 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3470 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3099 def accept(visitor); end # def case_keyword: () -> String # - # source://prism//lib/prism/node.rb#3530 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3159 def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3516 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3145 def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3475 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3104 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3489 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3118 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3480 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3109 def compact_child_nodes; end # attr_reader conditions: Array[Prism::node] # - # source://prism//lib/prism/node.rb#3510 - sig { returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3139 def conditions; end - # attr_reader consequent: ElseNode? + # Returns the else clause of the case node. This method is deprecated in + # favor of #else_clause. # - # source://prism//lib/prism/node.rb#3513 - sig { returns(T.nilable(Prism::ElseNode)) } + # source://prism//lib/prism/node_ext.rb#476 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[Prism::node], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode # - # source://prism//lib/prism/node.rb#3494 - 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 + # source://prism//lib/prism/node.rb#3123 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3475 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3104 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, predicate: Prism::node?, conditions: Array[Prism::node], else_clause: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location } # - # source://prism//lib/prism/node.rb#3502 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3131 def deconstruct_keys(keys); end + # attr_reader else_clause: ElseNode? + # + # source://prism//lib/prism/node.rb#3142 + def else_clause; end + # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#3535 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3164 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3523 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3152 def end_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -4489,44 +3589,25 @@ class Prism::CaseNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#3540 + # source://prism//lib/prism/node.rb#3169 sig { override.returns(String) } def inspect; end # attr_reader predicate: Prism::node? # - # source://prism//lib/prism/node.rb#3507 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#3136 def predicate; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#3558 + # source://prism//lib/prism/node.rb#3174 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3568 + # source://prism//lib/prism/node.rb#3179 def type; end end end @@ -4536,124 +3617,85 @@ end # class Foo end # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3589 +# source://prism//lib/prism/node.rb#3200 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 + # Initialize a new ClassNode node. # # @return [ClassNode] a new instance of ClassNode # - # source://prism//lib/prism/node.rb#3591 - 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 + # source://prism//lib/prism/node.rb#3202 + def initialize(source, node_id, location, flags, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name); 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#3733 + # source://prism//lib/prism/node.rb#3328 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3605 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3218 def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#3671 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#3284 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3610 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3223 def child_nodes; end # def class_keyword: () -> String # - # source://prism//lib/prism/node.rb#3684 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3297 def class_keyword; end # attr_reader class_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3645 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3258 def class_keyword_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3624 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3237 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3615 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3228 def compact_child_nodes; end # attr_reader constant_path: Prism::node # - # source://prism//lib/prism/node.rb#3652 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#3265 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?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) -> ClassNode # - # source://prism//lib/prism/node.rb#3629 - 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 + # source://prism//lib/prism/node.rb#3242 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), inheritance_operator_loc: T.unsafe(nil), superclass: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3610 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3223 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, 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 } # - # source://prism//lib/prism/node.rb#3637 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3250 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#3694 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3307 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3674 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3287 def end_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -4661,68 +3703,45 @@ class Prism::ClassNode < ::Prism::Node # def inheritance_operator: () -> String? # - # source://prism//lib/prism/node.rb#3689 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#3302 def inheritance_operator; end # attr_reader inheritance_operator_loc: Location? # - # source://prism//lib/prism/node.rb#3655 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#3268 def inheritance_operator_loc; end # def inspect -> String # - # source://prism//lib/prism/node.rb#3699 + # source://prism//lib/prism/node.rb#3312 sig { override.returns(String) } def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#3642 - sig { returns(T::Array[Symbol]) } + # source://prism//lib/prism/node.rb#3255 def locals; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#3681 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3294 def name; end # attr_reader superclass: Prism::node? # - # source://prism//lib/prism/node.rb#3668 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#3281 def superclass; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#3717 + # source://prism//lib/prism/node.rb#3317 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3727 + # source://prism//lib/prism/node.rb#3322 def type; end end end @@ -4732,83 +3751,58 @@ end # @@target &&= value # ^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3751 +# source://prism//lib/prism/node.rb#3346 class Prism::ClassVariableAndWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new ClassVariableAndWriteNode node. # # @return [ClassVariableAndWriteNode] a new instance of ClassVariableAndWriteNode # - # source://prism//lib/prism/node.rb#3753 - 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 + # source://prism//lib/prism/node.rb#3348 + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#3855 + # source://prism//lib/prism/node.rb#3434 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3763 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3360 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3768 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3365 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3778 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3375 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3773 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3370 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableAndWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode # - # source://prism//lib/prism/node.rb#3783 - 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 + # source://prism//lib/prism/node.rb#3380 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3768 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3365 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#3791 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3388 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#127 + # source://prism//lib/prism/desugar_compiler.rb#164 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -4816,68 +3810,45 @@ class Prism::ClassVariableAndWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#3821 + # source://prism//lib/prism/node.rb#3418 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#3796 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3393 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#3799 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3396 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#3816 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3413 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#3806 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3403 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3839 + # source://prism//lib/prism/node.rb#3423 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#3813 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#3410 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#3849 + # source://prism//lib/prism/node.rb#3428 def type; end end end @@ -4887,97 +3858,68 @@ end # @@target += value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3868 +# source://prism//lib/prism/node.rb#3447 class Prism::ClassVariableOperatorWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # Initialize a new ClassVariableOperatorWriteNode node. # # @return [ClassVariableOperatorWriteNode] a new instance of ClassVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#3870 - sig do - params( - source: Prism::Source, - name: Symbol, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).void - end - def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end + # source://prism//lib/prism/node.rb#3449 + def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); 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#3971 + # source://prism//lib/prism/node.rb#3534 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3881 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3462 def accept(visitor); end # attr_reader binary_operator: Symbol # - # source://prism//lib/prism/node.rb#3934 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3515 def binary_operator; end # attr_reader binary_operator_loc: Location # - # source://prism//lib/prism/node.rb#3924 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3505 def binary_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3886 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3467 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3896 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3477 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3891 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3472 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#3901 - sig do - params( - name: Symbol, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).returns(Prism::ClassVariableOperatorWriteNode) - end - def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#3482 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3886 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3467 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } # - # source://prism//lib/prism/node.rb#3909 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3490 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#139 + # source://prism//lib/prism/desugar_compiler.rb#176 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -4985,68 +3927,47 @@ class Prism::ClassVariableOperatorWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#3937 + # source://prism//lib/prism/node.rb#3518 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#3914 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3495 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#3917 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3498 def name_loc; end # Returns the binary operator used to modify the receiver. This method is # deprecated in favor of #binary_operator. # - # source://prism//lib/prism/node_ext.rb#339 + # source://prism//lib/prism/node_ext.rb#355 def operator; end # Returns the location of the binary operator used to modify the receiver. # This method is deprecated in favor of #binary_operator_loc. # - # source://prism//lib/prism/node_ext.rb#346 + # source://prism//lib/prism/node_ext.rb#362 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#3955 + # source://prism//lib/prism/node.rb#3523 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#3931 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#3512 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#3965 + # source://prism//lib/prism/node.rb#3528 def type; end end end @@ -5056,83 +3977,58 @@ end # @@target ||= value # ^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3985 +# source://prism//lib/prism/node.rb#3548 class Prism::ClassVariableOrWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new ClassVariableOrWriteNode node. # # @return [ClassVariableOrWriteNode] a new instance of ClassVariableOrWriteNode # - # source://prism//lib/prism/node.rb#3987 - 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 + # source://prism//lib/prism/node.rb#3550 + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#4089 + # source://prism//lib/prism/node.rb#3636 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3997 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3562 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4002 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3567 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4012 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3577 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4007 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3572 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableOrWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode # - # source://prism//lib/prism/node.rb#4017 - 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 + # source://prism//lib/prism/node.rb#3582 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4002 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3567 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#4025 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3590 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#133 + # source://prism//lib/prism/desugar_compiler.rb#170 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -5140,68 +4036,45 @@ class Prism::ClassVariableOrWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#4055 + # source://prism//lib/prism/node.rb#3620 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4030 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3595 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#4033 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3598 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4050 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3615 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4040 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3605 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#4073 + # source://prism//lib/prism/node.rb#3625 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4047 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#3612 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#4083 + # source://prism//lib/prism/node.rb#3630 def type; end end end @@ -5211,63 +4084,55 @@ end # @@foo # ^^^^^ # -# source://prism//lib/prism/node.rb#4102 +# source://prism//lib/prism/node.rb#3649 class Prism::ClassVariableReadNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new ClassVariableReadNode node. # # @return [ClassVariableReadNode] a new instance of ClassVariableReadNode # - # source://prism//lib/prism/node.rb#4104 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#3651 + def initialize(source, node_id, location, flags, name); 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#4185 + # source://prism//lib/prism/node.rb#3716 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4111 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3660 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4116 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3665 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4126 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3675 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4121 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3670 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> ClassVariableReadNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode # - # source://prism//lib/prism/node.rb#4131 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableReadNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#3680 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4116 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3665 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#4139 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3688 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -5275,7 +4140,7 @@ class Prism::ClassVariableReadNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#4151 + # source://prism//lib/prism/node.rb#3700 sig { override.returns(String) } def inspect; end @@ -5285,38 +4150,19 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # @@_test # name `:@@_test` # - # source://prism//lib/prism/node.rb#4148 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3697 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#4169 + # source://prism//lib/prism/node.rb#3705 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#4179 + # source://prism//lib/prism/node.rb#3710 def type; end end end @@ -5326,63 +4172,55 @@ end # @@foo, @@bar = baz # ^^^^^ ^^^^^ # -# source://prism//lib/prism/node.rb#4195 +# source://prism//lib/prism/node.rb#3726 class Prism::ClassVariableTargetNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new ClassVariableTargetNode node. # # @return [ClassVariableTargetNode] a new instance of ClassVariableTargetNode # - # source://prism//lib/prism/node.rb#4197 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#3728 + def initialize(source, node_id, location, flags, name); 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#4274 + # source://prism//lib/prism/node.rb#3789 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4204 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3737 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4209 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3742 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4219 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3752 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4214 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3747 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> ClassVariableTargetNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode # - # source://prism//lib/prism/node.rb#4224 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableTargetNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#3757 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4209 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3742 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#4232 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3765 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -5390,44 +4228,25 @@ class Prism::ClassVariableTargetNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#4240 + # source://prism//lib/prism/node.rb#3773 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4237 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3770 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#4258 + # source://prism//lib/prism/node.rb#3778 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#4268 + # source://prism//lib/prism/node.rb#3783 def type; end end end @@ -5437,80 +4256,55 @@ end # @@foo = 1 # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4284 +# source://prism//lib/prism/node.rb#3799 class Prism::ClassVariableWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # Initialize a new ClassVariableWriteNode node. # # @return [ClassVariableWriteNode] a new instance of ClassVariableWriteNode # - # source://prism//lib/prism/node.rb#4286 - 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 + # source://prism//lib/prism/node.rb#3801 + def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); 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#4404 + # source://prism//lib/prism/node.rb#3903 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4296 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3813 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4301 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3818 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4311 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3828 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4306 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3823 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ClassVariableWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode # - # source://prism//lib/prism/node.rb#4316 - 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 + # source://prism//lib/prism/node.rb#3833 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4301 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3818 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#4324 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3841 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -5518,7 +4312,7 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#4370 + # source://prism//lib/prism/node.rb#3887 sig { override.returns(String) } def inspect; end @@ -5528,8 +4322,7 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # # @@_test = :test # name `@@_test` # - # source://prism//lib/prism/node.rb#4333 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3850 def name; end # The location of the variable name. @@ -5537,14 +4330,12 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # @@foo = :bar # ^^^^^ # - # source://prism//lib/prism/node.rb#4339 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3856 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4365 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3882 def operator; end # The location of the `=` operator. @@ -5552,26 +4343,12 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # @@foo = :bar # ^ # - # source://prism//lib/prism/node.rb#4358 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3875 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#4388 + # source://prism//lib/prism/node.rb#3892 sig { override.returns(Symbol) } def type; end @@ -5583,19 +4360,13 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # @@_xyz = 123 # ^^^ # - # source://prism//lib/prism/node.rb#4352 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#3869 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#4398 + # source://prism//lib/prism/node.rb#3897 def type; end end end @@ -5603,7 +4374,7 @@ 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#366 +# source://prism//lib/prism/parse_result.rb#375 class Prism::Comment abstract! @@ -5611,25 +4382,25 @@ class Prism::Comment # # @return [Comment] a new instance of Comment # - # source://prism//lib/prism/parse_result.rb#371 + # source://prism//lib/prism/parse_result.rb#380 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#376 + # source://prism//lib/prism/parse_result.rb#385 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#368 + # source://prism//lib/prism/parse_result.rb#377 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#381 + # source://prism//lib/prism/parse_result.rb#390 sig { returns(String) } def slice; end @@ -6586,83 +5357,58 @@ end # Target &&= value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4417 +# source://prism//lib/prism/node.rb#3916 class Prism::ConstantAndWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new ConstantAndWriteNode node. # # @return [ConstantAndWriteNode] a new instance of ConstantAndWriteNode # - # source://prism//lib/prism/node.rb#4419 - 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 + # source://prism//lib/prism/node.rb#3918 + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#4521 + # source://prism//lib/prism/node.rb#4004 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4429 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#3930 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4434 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3935 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4444 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#3945 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4439 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#3940 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantAndWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode # - # source://prism//lib/prism/node.rb#4449 - 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 + # source://prism//lib/prism/node.rb#3950 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4434 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#3935 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#4457 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#3958 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#145 + # source://prism//lib/prism/desugar_compiler.rb#182 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -6670,68 +5416,45 @@ class Prism::ConstantAndWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#4487 + # source://prism//lib/prism/node.rb#3988 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4462 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#3963 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#4465 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3966 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4482 - sig { returns(String) } + # source://prism//lib/prism/node.rb#3983 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4472 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#3973 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#4505 + # source://prism//lib/prism/node.rb#3993 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4479 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#3980 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#4515 + # source://prism//lib/prism/node.rb#3998 def type; end end end @@ -6741,97 +5464,68 @@ end # Target += value # ^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4534 +# source://prism//lib/prism/node.rb#4017 class Prism::ConstantOperatorWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # Initialize a new ConstantOperatorWriteNode node. # # @return [ConstantOperatorWriteNode] a new instance of ConstantOperatorWriteNode # - # source://prism//lib/prism/node.rb#4536 - sig do - params( - source: Prism::Source, - name: Symbol, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).void - end - def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end + # source://prism//lib/prism/node.rb#4019 + def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); 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#4637 + # source://prism//lib/prism/node.rb#4104 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4547 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4032 def accept(visitor); end # attr_reader binary_operator: Symbol # - # source://prism//lib/prism/node.rb#4600 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#4085 def binary_operator; end # attr_reader binary_operator_loc: Location # - # source://prism//lib/prism/node.rb#4590 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4075 def binary_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4552 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4037 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4562 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4047 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4557 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4042 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode # - # source://prism//lib/prism/node.rb#4567 - sig do - params( - name: Symbol, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).returns(Prism::ConstantOperatorWriteNode) - end - def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#4052 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4552 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4037 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } # - # source://prism//lib/prism/node.rb#4575 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4060 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#157 + # source://prism//lib/prism/desugar_compiler.rb#194 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -6839,68 +5533,47 @@ class Prism::ConstantOperatorWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#4603 + # source://prism//lib/prism/node.rb#4088 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4580 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#4065 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#4583 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4068 def name_loc; end # Returns the binary operator used to modify the receiver. This method is # deprecated in favor of #binary_operator. # - # source://prism//lib/prism/node_ext.rb#355 + # source://prism//lib/prism/node_ext.rb#371 def operator; end # Returns the location of the binary operator used to modify the receiver. # This method is deprecated in favor of #binary_operator_loc. # - # source://prism//lib/prism/node_ext.rb#362 + # source://prism//lib/prism/node_ext.rb#378 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#4621 + # source://prism//lib/prism/node.rb#4093 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4597 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#4082 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#4631 + # source://prism//lib/prism/node.rb#4098 def type; end end end @@ -6910,83 +5583,58 @@ end # Target ||= value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4651 +# source://prism//lib/prism/node.rb#4118 class Prism::ConstantOrWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new ConstantOrWriteNode node. # # @return [ConstantOrWriteNode] a new instance of ConstantOrWriteNode # - # source://prism//lib/prism/node.rb#4653 - 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 + # source://prism//lib/prism/node.rb#4120 + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#4755 + # source://prism//lib/prism/node.rb#4206 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4663 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4132 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4668 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4137 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4678 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4147 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4673 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4142 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantOrWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode # - # source://prism//lib/prism/node.rb#4683 - 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 + # source://prism//lib/prism/node.rb#4152 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4668 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4137 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#4691 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4160 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#151 + # source://prism//lib/prism/desugar_compiler.rb#188 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -6994,68 +5642,45 @@ class Prism::ConstantOrWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#4721 + # source://prism//lib/prism/node.rb#4190 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4696 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#4165 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#4699 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4168 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4716 - sig { returns(String) } + # source://prism//lib/prism/node.rb#4185 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4706 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4175 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#4739 + # source://prism//lib/prism/node.rb#4195 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4713 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#4182 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#4749 + # source://prism//lib/prism/node.rb#4200 def type; end end end @@ -7065,78 +5690,55 @@ end # Parent::Child &&= value # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4768 +# source://prism//lib/prism/node.rb#4219 class Prism::ConstantPathAndWriteNode < ::Prism::Node - # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new ConstantPathAndWriteNode node. # # @return [ConstantPathAndWriteNode] a new instance of ConstantPathAndWriteNode # - # source://prism//lib/prism/node.rb#4770 - 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 + # source://prism//lib/prism/node.rb#4221 + def initialize(source, node_id, location, flags, target, operator_loc, value); 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#4864 + # source://prism//lib/prism/node.rb#4299 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4779 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4232 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4784 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4237 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4794 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4247 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4789 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4242 def compact_child_nodes; end - # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathAndWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode # - # source://prism//lib/prism/node.rb#4799 - 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 + # source://prism//lib/prism/node.rb#4252 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4784 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4237 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#4807 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4260 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -7144,62 +5746,40 @@ class Prism::ConstantPathAndWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#4830 + # source://prism//lib/prism/node.rb#4283 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4825 - sig { returns(String) } + # source://prism//lib/prism/node.rb#4278 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4815 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4268 def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//lib/prism/node.rb#4812 - sig { returns(Prism::ConstantPathNode) } + # source://prism//lib/prism/node.rb#4265 def target; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#4848 + # source://prism//lib/prism/node.rb#4288 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4822 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#4275 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#4858 + # source://prism//lib/prism/node.rb#4293 def type; end end end @@ -7209,93 +5789,67 @@ end # Foo::Bar # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#4876 +# source://prism//lib/prism/node.rb#4311 class Prism::ConstantPathNode < ::Prism::Node - # def initialize: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, Location location) -> void + # Initialize a new ConstantPathNode node. # # @return [ConstantPathNode] a new instance of ConstantPathNode # - # source://prism//lib/prism/node.rb#4878 - sig do - params( - source: Prism::Source, - parent: T.nilable(Prism::Node), - name: T.nilable(Symbol), - delimiter_loc: Prism::Location, - name_loc: Prism::Location, - location: Prism::Location - ).void - end - def initialize(source, parent, name, delimiter_loc, name_loc, location); end + # source://prism//lib/prism/node.rb#4313 + def initialize(source, node_id, location, flags, parent, name, delimiter_loc, name_loc); 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#5003 + # source://prism//lib/prism/node.rb#4422 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4888 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4325 def accept(visitor); end # Previously, we had a child node on this class that contained either a # constant read or a missing node. To not cause a breaking change, we # continue to supply that API. # - # source://prism//lib/prism/node_ext.rb#196 + # source://prism//lib/prism/node_ext.rb#202 def child; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4893 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4330 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4905 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4342 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4898 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4335 def compact_child_nodes; end - # def copy: (?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location, ?location: Location) -> ConstantPathNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode # - # source://prism//lib/prism/node.rb#4910 - sig do - params( - parent: T.nilable(Prism::Node), - name: T.nilable(Symbol), - delimiter_loc: Prism::Location, - name_loc: Prism::Location, - location: Prism::Location - ).returns(Prism::ConstantPathNode) - end - def copy(parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#4347 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4893 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4330 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location } # - # source://prism//lib/prism/node.rb#4918 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4355 def deconstruct_keys(keys); end # def delimiter: () -> String # - # source://prism//lib/prism/node.rb#4964 - sig { returns(String) } + # source://prism//lib/prism/node.rb#4401 def delimiter; end # The location of the `::` delimiter. @@ -7306,8 +5860,7 @@ class Prism::ConstantPathNode < ::Prism::Node # One::Two # ^^ # - # source://prism//lib/prism/node.rb#4944 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4381 def delimiter_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -7315,27 +5868,26 @@ class Prism::ConstantPathNode < ::Prism::Node # Returns the full name of this constant path. For example: "Foo::Bar" # - # source://prism//lib/prism/node_ext.rb#189 + # source://prism//lib/prism/node_ext.rb#195 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#167 + # source://prism//lib/prism/node_ext.rb#173 sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect -> String # - # source://prism//lib/prism/node.rb#4969 + # source://prism//lib/prism/node.rb#4406 sig { override.returns(String) } def inspect; end # The name of the constant being accessed. This could be `nil` in the event of a syntax error. # - # source://prism//lib/prism/node.rb#4935 - sig { returns(T.nilable(Symbol)) } + # source://prism//lib/prism/node.rb#4372 def name; end # The location of the name of the constant. @@ -7346,8 +5898,7 @@ class Prism::ConstantPathNode < ::Prism::Node # One::Two # ^^^ # - # source://prism//lib/prism/node.rb#4957 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4394 def name_loc; end # The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree. @@ -7361,38 +5912,19 @@ class Prism::ConstantPathNode < ::Prism::Node # a.b::C # ^^^ # - # source://prism//lib/prism/node.rb#4932 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#4369 def parent; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#4987 + # source://prism//lib/prism/node.rb#4411 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#4997 + # source://prism//lib/prism/node.rb#4416 def type; end end end @@ -7404,14 +5936,14 @@ end # var::Bar::Baz -> raises because the first part of the constant path is a # local variable # -# source://prism//lib/prism/node_ext.rb#158 +# source://prism//lib/prism/node_ext.rb#164 class Prism::ConstantPathNode::DynamicPartsInConstantPathError < ::StandardError; end # An error class raised when missing nodes are found while computing a # constant path's full name. For example: # Foo:: -> raises because the constant path is missing the last part # -# source://prism//lib/prism/node_ext.rb#163 +# source://prism//lib/prism/node_ext.rb#169 class Prism::ConstantPathNode::MissingNodesInConstantPathError < ::StandardError; end # Represents assigning to a constant path using an operator that isn't `=`. @@ -7419,92 +5951,65 @@ class Prism::ConstantPathNode::MissingNodesInConstantPathError < ::StandardError # Parent::Child += value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#5016 +# source://prism//lib/prism/node.rb#4435 class Prism::ConstantPathOperatorWriteNode < ::Prism::Node - # def initialize: (ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # Initialize a new ConstantPathOperatorWriteNode node. # # @return [ConstantPathOperatorWriteNode] a new instance of ConstantPathOperatorWriteNode # - # source://prism//lib/prism/node.rb#5018 - sig do - params( - source: Prism::Source, - target: Prism::ConstantPathNode, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).void - end - def initialize(source, target, binary_operator_loc, value, binary_operator, location); end + # source://prism//lib/prism/node.rb#4437 + def initialize(source, node_id, location, flags, target, binary_operator_loc, value, binary_operator); 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#5111 + # source://prism//lib/prism/node.rb#4514 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5028 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4449 def accept(visitor); end # attr_reader binary_operator: Symbol # - # source://prism//lib/prism/node.rb#5074 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#4495 def binary_operator; end # attr_reader binary_operator_loc: Location # - # source://prism//lib/prism/node.rb#5064 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4485 def binary_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5033 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4454 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5043 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4464 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5038 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4459 def compact_child_nodes; end - # def copy: (?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode # - # source://prism//lib/prism/node.rb#5048 - sig do - params( - target: Prism::ConstantPathNode, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).returns(Prism::ConstantPathOperatorWriteNode) - end - def copy(target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#4469 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5033 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4454 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } # - # source://prism//lib/prism/node.rb#5056 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4477 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -7512,62 +6017,42 @@ class Prism::ConstantPathOperatorWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#5077 + # source://prism//lib/prism/node.rb#4498 sig { override.returns(String) } def inspect; end # Returns the binary operator used to modify the receiver. This method is # deprecated in favor of #binary_operator. # - # source://prism//lib/prism/node_ext.rb#371 + # source://prism//lib/prism/node_ext.rb#387 def operator; end # Returns the location of the binary operator used to modify the receiver. # This method is deprecated in favor of #binary_operator_loc. # - # source://prism//lib/prism/node_ext.rb#378 + # source://prism//lib/prism/node_ext.rb#394 def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//lib/prism/node.rb#5061 - sig { returns(Prism::ConstantPathNode) } + # source://prism//lib/prism/node.rb#4482 def target; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#5095 + # source://prism//lib/prism/node.rb#4503 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#5071 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#4492 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#5105 + # source://prism//lib/prism/node.rb#4508 def type; end end end @@ -7577,78 +6062,55 @@ end # Parent::Child ||= value # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#5124 +# source://prism//lib/prism/node.rb#4527 class Prism::ConstantPathOrWriteNode < ::Prism::Node - # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new ConstantPathOrWriteNode node. # # @return [ConstantPathOrWriteNode] a new instance of ConstantPathOrWriteNode # - # source://prism//lib/prism/node.rb#5126 - 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 + # source://prism//lib/prism/node.rb#4529 + def initialize(source, node_id, location, flags, target, operator_loc, value); 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#5220 + # source://prism//lib/prism/node.rb#4607 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5135 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4540 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5140 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4545 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5150 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4555 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5145 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4550 def compact_child_nodes; end - # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathOrWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode # - # source://prism//lib/prism/node.rb#5155 - 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 + # source://prism//lib/prism/node.rb#4560 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5140 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4545 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#5163 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4568 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -7656,62 +6118,40 @@ class Prism::ConstantPathOrWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#5186 + # source://prism//lib/prism/node.rb#4591 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#5181 - sig { returns(String) } + # source://prism//lib/prism/node.rb#4586 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#5171 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4576 def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//lib/prism/node.rb#5168 - sig { returns(Prism::ConstantPathNode) } + # source://prism//lib/prism/node.rb#4573 def target; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#5204 + # source://prism//lib/prism/node.rb#4596 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#5178 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#4583 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#5214 + # source://prism//lib/prism/node.rb#4601 def type; end end end @@ -7721,99 +6161,72 @@ end # Foo::Foo, Bar::Bar = baz # ^^^^^^^^ ^^^^^^^^ # -# source://prism//lib/prism/node.rb#5232 +# source://prism//lib/prism/node.rb#4619 class Prism::ConstantPathTargetNode < ::Prism::Node - # def initialize: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, Location location) -> void + # Initialize a new ConstantPathTargetNode node. # # @return [ConstantPathTargetNode] a new instance of ConstantPathTargetNode # - # source://prism//lib/prism/node.rb#5234 - sig do - params( - source: Prism::Source, - parent: T.nilable(Prism::Node), - name: T.nilable(Symbol), - delimiter_loc: Prism::Location, - name_loc: Prism::Location, - location: Prism::Location - ).void - end - def initialize(source, parent, name, delimiter_loc, name_loc, location); end + # source://prism//lib/prism/node.rb#4621 + def initialize(source, node_id, location, flags, parent, name, delimiter_loc, name_loc); 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#5338 + # source://prism//lib/prism/node.rb#4709 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5244 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4633 def accept(visitor); end # Previously, we had a child node on this class that contained either a # constant read or a missing node. To not cause a breaking change, we # continue to supply that API. # - # source://prism//lib/prism/node_ext.rb#232 + # source://prism//lib/prism/node_ext.rb#243 def child; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5249 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4638 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5261 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4650 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5254 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4643 def compact_child_nodes; end - # def copy: (?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location, ?location: Location) -> ConstantPathTargetNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode # - # source://prism//lib/prism/node.rb#5266 - sig do - params( - parent: T.nilable(Prism::Node), - name: T.nilable(Symbol), - delimiter_loc: Prism::Location, - name_loc: Prism::Location, - location: Prism::Location - ).returns(Prism::ConstantPathTargetNode) - end - def copy(parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#4655 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5249 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4638 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location } # - # source://prism//lib/prism/node.rb#5274 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4663 def deconstruct_keys(keys); end # def delimiter: () -> String # - # source://prism//lib/prism/node.rb#5299 - sig { returns(String) } + # source://prism//lib/prism/node.rb#4688 def delimiter; end # attr_reader delimiter_loc: Location # - # source://prism//lib/prism/node.rb#5285 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4674 def delimiter_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -7821,69 +6234,48 @@ class Prism::ConstantPathTargetNode < ::Prism::Node # Returns the full name of this constant path. For example: "Foo::Bar" # - # source://prism//lib/prism/node_ext.rb#225 + # source://prism//lib/prism/node_ext.rb#236 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#205 + # source://prism//lib/prism/node_ext.rb#216 sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect -> String # - # source://prism//lib/prism/node.rb#5304 + # source://prism//lib/prism/node.rb#4693 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol? # - # source://prism//lib/prism/node.rb#5282 - sig { returns(T.nilable(Symbol)) } + # source://prism//lib/prism/node.rb#4671 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#5292 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4681 def name_loc; end # attr_reader parent: Prism::node? # - # source://prism//lib/prism/node.rb#5279 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#4668 def parent; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#5322 + # source://prism//lib/prism/node.rb#4698 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#5332 + # source://prism//lib/prism/node.rb#4703 def type; end end end @@ -7899,78 +6291,55 @@ end # ::Foo::Bar = 1 # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#5357 +# source://prism//lib/prism/node.rb#4728 class Prism::ConstantPathWriteNode < ::Prism::Node - # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new ConstantPathWriteNode node. # # @return [ConstantPathWriteNode] a new instance of ConstantPathWriteNode # - # source://prism//lib/prism/node.rb#5359 - 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 + # source://prism//lib/prism/node.rb#4730 + def initialize(source, node_id, location, flags, target, operator_loc, value); 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 + # source://prism//lib/prism/node.rb#4820 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5368 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4741 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5373 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4746 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5383 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4756 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5378 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4751 def compact_child_nodes; end - # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode # - # source://prism//lib/prism/node.rb#5388 - 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 + # source://prism//lib/prism/node.rb#4761 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5373 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4746 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#5396 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4769 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -7978,14 +6347,13 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#5431 + # source://prism//lib/prism/node.rb#4804 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#5426 - sig { returns(String) } + # source://prism//lib/prism/node.rb#4799 def operator; end # The location of the `=` operator. @@ -7993,8 +6361,7 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # ::ABC = 123 # ^ # - # source://prism//lib/prism/node.rb#5413 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#4786 def operator_loc; end # A node representing the constant path being written to. @@ -8005,26 +6372,12 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # ::Foo = :abc # ^^^^^ # - # source://prism//lib/prism/node.rb#5407 - sig { returns(Prism::ConstantPathNode) } + # source://prism//lib/prism/node.rb#4780 def target; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#5449 + # source://prism//lib/prism/node.rb#4809 sig { override.returns(Symbol) } def type; end @@ -8033,19 +6386,13 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # FOO::BAR = :abc # ^^^^ # - # source://prism//lib/prism/node.rb#5423 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#4796 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#5459 + # source://prism//lib/prism/node.rb#4814 def type; end end end @@ -8055,63 +6402,55 @@ end # Foo # ^^^ # -# source://prism//lib/prism/node.rb#5477 +# source://prism//lib/prism/node.rb#4832 class Prism::ConstantReadNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new ConstantReadNode node. # # @return [ConstantReadNode] a new instance of ConstantReadNode # - # source://prism//lib/prism/node.rb#5479 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#4834 + def initialize(source, node_id, location, flags, name); 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#5560 + # source://prism//lib/prism/node.rb#4899 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5486 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4843 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5491 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4848 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5501 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4858 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5496 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4853 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> ConstantReadNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode # - # source://prism//lib/prism/node.rb#5506 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantReadNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#4863 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5491 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4848 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#5514 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4871 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -8119,20 +6458,20 @@ class Prism::ConstantReadNode < ::Prism::Node # Returns the full name of this constant. For example: "Foo" # - # source://prism//lib/prism/node_ext.rb#133 + # source://prism//lib/prism/node_ext.rb#139 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#128 + # source://prism//lib/prism/node_ext.rb#134 sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect -> String # - # source://prism//lib/prism/node.rb#5526 + # source://prism//lib/prism/node.rb#4883 sig { override.returns(String) } def inspect; end @@ -8142,38 +6481,19 @@ class Prism::ConstantReadNode < ::Prism::Node # # SOME_CONSTANT # name `:SOME_CONSTANT` # - # source://prism//lib/prism/node.rb#5523 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#4880 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#5544 + # source://prism//lib/prism/node.rb#4888 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#5554 + # source://prism//lib/prism/node.rb#4893 def type; end end end @@ -8183,63 +6503,55 @@ end # Foo, Bar = baz # ^^^ ^^^ # -# source://prism//lib/prism/node.rb#5570 +# source://prism//lib/prism/node.rb#4909 class Prism::ConstantTargetNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new ConstantTargetNode node. # # @return [ConstantTargetNode] a new instance of ConstantTargetNode # - # source://prism//lib/prism/node.rb#5572 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#4911 + def initialize(source, node_id, location, flags, name); 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#5649 + # source://prism//lib/prism/node.rb#4972 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5579 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4920 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5584 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4925 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5594 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#4935 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5589 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#4930 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> ConstantTargetNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode # - # source://prism//lib/prism/node.rb#5599 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantTargetNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#4940 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5584 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#4925 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#5607 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#4948 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -8247,57 +6559,38 @@ class Prism::ConstantTargetNode < ::Prism::Node # Returns the full name of this constant. For example: "Foo" # - # source://prism//lib/prism/node_ext.rb#246 + # source://prism//lib/prism/node_ext.rb#262 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#241 + # source://prism//lib/prism/node_ext.rb#257 sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect -> String # - # source://prism//lib/prism/node.rb#5615 + # source://prism//lib/prism/node.rb#4956 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#5612 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#4953 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#5633 + # source://prism//lib/prism/node.rb#4961 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#5643 + # source://prism//lib/prism/node.rb#4966 def type; end end end @@ -8307,80 +6600,55 @@ end # Foo = 1 # ^^^^^^^ # -# source://prism//lib/prism/node.rb#5659 +# source://prism//lib/prism/node.rb#4982 class Prism::ConstantWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # Initialize a new ConstantWriteNode node. # # @return [ConstantWriteNode] a new instance of ConstantWriteNode # - # source://prism//lib/prism/node.rb#5661 - 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 + # source://prism//lib/prism/node.rb#4984 + def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); 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#5779 + # source://prism//lib/prism/node.rb#5086 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5671 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#4996 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5676 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5001 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5686 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5011 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5681 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5006 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ConstantWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode # - # source://prism//lib/prism/node.rb#5691 - 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 + # source://prism//lib/prism/node.rb#5016 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5676 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5001 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#5699 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5024 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -8388,20 +6656,20 @@ class Prism::ConstantWriteNode < ::Prism::Node # Returns the full name of this constant. For example: "Foo" # - # source://prism//lib/prism/node_ext.rb#146 + # source://prism//lib/prism/node_ext.rb#152 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#141 + # source://prism//lib/prism/node_ext.rb#147 sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect -> String # - # source://prism//lib/prism/node.rb#5745 + # source://prism//lib/prism/node.rb#5070 sig { override.returns(String) } def inspect; end @@ -8411,8 +6679,7 @@ class Prism::ConstantWriteNode < ::Prism::Node # # XYZ = 1 # name `:XYZ` # - # source://prism//lib/prism/node.rb#5708 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#5033 def name; end # The location of the constant name. @@ -8420,14 +6687,12 @@ class Prism::ConstantWriteNode < ::Prism::Node # FOO = 1 # ^^^ # - # source://prism//lib/prism/node.rb#5714 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5039 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#5740 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5065 def operator; end # The location of the `=` operator. @@ -8435,26 +6700,12 @@ class Prism::ConstantWriteNode < ::Prism::Node # FOO = :bar # ^ # - # source://prism//lib/prism/node.rb#5733 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5058 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#5763 + # source://prism//lib/prism/node.rb#5075 sig { override.returns(Symbol) } def type; end @@ -8466,19 +6717,13 @@ class Prism::ConstantWriteNode < ::Prism::Node # MyClass = Class.new # ^^^^^^^^^ # - # source://prism//lib/prism/node.rb#5727 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#5052 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#5773 + # source://prism//lib/prism/node.rb#5080 def type; end end end @@ -8489,796 +6734,2636 @@ end # source = Prism::Source.for("[1]") # # Prism::ArrayNode.new( +# source, +# 0, +# Prism::Location.new(source, 0, 3), +# 0, # [ # Prism::IntegerNode.new( -# Prism::IntegerBaseFlags::DECIMAL, -# 1, +# source, +# 0, # Prism::Location.new(source, 1, 1), -# source +# Prism::IntegerBaseFlags::DECIMAL, +# 1 # ) # ], # Prism::Location.new(source, 0, 1), -# Prism::Location.new(source, 2, 1), -# source +# Prism::Location.new(source, 2, 1) # ) # # you could instead write: # -# source = Prism::Source.for("[1]") +# class Builder +# include Prism::DSL # -# ArrayNode( -# IntegerNode(Prism::IntegerBaseFlags::DECIMAL, 1, Location(source, 1, 1)), source), -# Location(source, 0, 1), -# Location(source, 2, 1), -# source -# ) +# attr_reader :default_source +# +# def initialize +# @default_source = source("[1]") +# end +# +# def build +# array_node( +# location: location(start_offset: 0, length: 3), +# elements: [ +# integer_node( +# location: location(start_offset: 1, length: 1), +# flags: integer_base_flag(:decimal), +# value: 1 +# ) +# ], +# opening_loc: location(start_offset: 0, length: 1), +# closing_loc: location(start_offset: 2, length: 1) +# ) +# end +# end # -# This is mostly helpful in the context of writing tests, but can also be used -# to generate trees programmatically. +# This is mostly helpful in the context of generating trees programmatically. # -# source://prism//lib/prism/dsl.rb#42 +# source://prism//lib/prism/dsl.rb#61 module Prism::DSL - private - - # Create a new AliasGlobalVariableNode node - # - # source://prism//lib/prism/dsl.rb#51 - def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end - - # Create a new AliasMethodNode node - # - # source://prism//lib/prism/dsl.rb#56 - def AliasMethodNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end - - # Create a new AlternationPatternNode node - # - # source://prism//lib/prism/dsl.rb#61 - def AlternationPatternNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end - - # Create a new AndNode node - # - # source://prism//lib/prism/dsl.rb#66 - def AndNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + extend ::Prism::DSL - # Create a new ArgumentsNode node + # Create a new AliasGlobalVariableNode node. # - # source://prism//lib/prism/dsl.rb#71 - def ArgumentsNode(flags, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#77 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + new_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode), + old_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode), + keyword_loc: Prism::Location + ).returns(Prism::AliasGlobalVariableNode) + end + def alias_global_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - # Create a new ArrayNode node + # Create a new AliasMethodNode node. # - # source://prism//lib/prism/dsl.rb#76 - def ArrayNode(flags, elements, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#82 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + new_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode), + old_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode), + keyword_loc: Prism::Location + ).returns(Prism::AliasMethodNode) + end + def alias_method_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - # Create a new ArrayPatternNode node + # Create a new AlternationPatternNode node. # - # source://prism//lib/prism/dsl.rb#81 - def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#87 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::AlternationPatternNode) + end + def alternation_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new AssocNode node + # Create a new AndNode node. # - # source://prism//lib/prism/dsl.rb#86 - def AssocNode(key, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#92 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::AndNode) + end + def and_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new AssocSplatNode node + # Create a new ArgumentsNode node. # - # source://prism//lib/prism/dsl.rb#91 - def AssocSplatNode(value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#97 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T::Array[Prism::Node] + ).returns(Prism::ArgumentsNode) + end + def arguments_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil)); end - # Create a new BackReferenceReadNode node + # Retrieve the value of one of the ArgumentsNodeFlags flags. # - # source://prism//lib/prism/dsl.rb#96 - def BackReferenceReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#832 + sig { params(name: Symbol).returns(Integer) } + def arguments_node_flag(name); end - # Create a new BeginNode node + # Create a new ArrayNode node. # - # source://prism//lib/prism/dsl.rb#101 - def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#102 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::ArrayNode) + end + def array_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new BlockArgumentNode node + # Retrieve the value of one of the ArrayNodeFlags flags. # - # source://prism//lib/prism/dsl.rb#106 - def BlockArgumentNode(expression, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#842 + sig { params(name: Symbol).returns(Integer) } + def array_node_flag(name); end - # Create a new BlockLocalVariableNode node + # Create a new ArrayPatternNode node. # - # source://prism//lib/prism/dsl.rb#111 - def BlockLocalVariableNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#107 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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) + ).returns(Prism::ArrayPatternNode) + end + def array_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), requireds: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new BlockNode node + # Create a new AssocNode node. # - # source://prism//lib/prism/dsl.rb#116 - def BlockNode(locals, parameters, body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#112 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location) + ).returns(Prism::AssocNode) + end + def assoc_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new BlockParameterNode node + # Create a new AssocSplatNode node. # - # source://prism//lib/prism/dsl.rb#121 - def BlockParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#117 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::AssocSplatNode) + end + def assoc_splat_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new BlockParametersNode node + # Create a new BackReferenceReadNode node. # - # source://prism//lib/prism/dsl.rb#126 - def BlockParametersNode(parameters, locals, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#122 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::BackReferenceReadNode) + end + def back_reference_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new BreakNode node + # Create a new BeginNode node. # - # source://prism//lib/prism/dsl.rb#131 - def BreakNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#127 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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) + ).returns(Prism::BeginNode) + end + def begin_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), begin_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), rescue_clause: T.unsafe(nil), else_clause: T.unsafe(nil), ensure_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - # Create a new CallAndWriteNode node + # Create a new BlockArgumentNode node. # - # source://prism//lib/prism/dsl.rb#136 - def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#132 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::BlockArgumentNode) + end + def block_argument_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new CallNode node + # Create a new BlockLocalVariableNode node. # - # source://prism//lib/prism/dsl.rb#141 - def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#137 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::BlockLocalVariableNode) + end + def block_local_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new CallOperatorWriteNode node + # Create a new BlockNode node. # - # source://prism//lib/prism/dsl.rb#146 - def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#142 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::BlockNode) + end + def block_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new CallOrWriteNode node + # Create a new BlockParameterNode node. # - # source://prism//lib/prism/dsl.rb#151 - def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#147 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::BlockParameterNode) + end + def block_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new CallTargetNode node + # Create a new BlockParametersNode node. # - # source://prism//lib/prism/dsl.rb#156 - def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#152 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parameters: T.nilable(Prism::ParametersNode), + locals: T::Array[Prism::BlockLocalVariableNode], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::BlockParametersNode) + end + def block_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new CapturePatternNode node + # Create a new BreakNode node. # - # source://prism//lib/prism/dsl.rb#161 - def CapturePatternNode(value, target, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#157 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location + ).returns(Prism::BreakNode) + end + def break_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - # Create a new CaseMatchNode node + # Create a new CallAndWriteNode node. # - # source://prism//lib/prism/dsl.rb#166 - def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#162 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + 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 + ).returns(Prism::CallAndWriteNode) + end + def call_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new CaseNode node + # Create a new CallNode node. # - # source://prism//lib/prism/dsl.rb#171 - def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#167 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + 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) + ).returns(Prism::CallNode) + end + def call_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end - # Create a new ClassNode node + # Retrieve the value of one of the CallNodeFlags flags. # - # source://prism//lib/prism/dsl.rb#176 - def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#850 + sig { params(name: Symbol).returns(Integer) } + def call_node_flag(name); end - # Create a new ClassVariableAndWriteNode node + # Create a new CallOperatorWriteNode node. # - # source://prism//lib/prism/dsl.rb#181 - def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#172 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + 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, + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::CallOperatorWriteNode) + end + def call_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ClassVariableOperatorWriteNode node + # Create a new CallOrWriteNode node. # - # source://prism//lib/prism/dsl.rb#186 - def ClassVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#177 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + 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 + ).returns(Prism::CallOrWriteNode) + end + def call_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ClassVariableOrWriteNode node + # Create a new CallTargetNode node. # - # source://prism//lib/prism/dsl.rb#191 - def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#182 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location + ).returns(Prism::CallTargetNode) + end + def call_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil)); end - # Create a new ClassVariableReadNode node + # Create a new CapturePatternNode node. # - # source://prism//lib/prism/dsl.rb#196 - def ClassVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#187 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + target: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::CapturePatternNode) + end + def capture_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new ClassVariableTargetNode node + # Create a new CaseMatchNode node. # - # source://prism//lib/prism/dsl.rb#201 - def ClassVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#192 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + else_clause: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location + ).returns(Prism::CaseMatchNode) + end + def case_match_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - # Create a new ClassVariableWriteNode node + # Create a new CaseNode node. # - # source://prism//lib/prism/dsl.rb#206 - def ClassVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#197 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + else_clause: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location + ).returns(Prism::CaseNode) + end + def case_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - # Create a new ConstantAndWriteNode node + # Create a new ClassNode node. # - # source://prism//lib/prism/dsl.rb#211 - def ConstantAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#202 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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 + ).returns(Prism::ClassNode) + end + def class_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), inheritance_operator_loc: T.unsafe(nil), superclass: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new ConstantOperatorWriteNode node + # Create a new ClassVariableAndWriteNode node. # - # source://prism//lib/prism/dsl.rb#216 - def ConstantOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#207 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ClassVariableAndWriteNode) + end + def class_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ConstantOrWriteNode node + # Create a new ClassVariableOperatorWriteNode node. # - # source://prism//lib/prism/dsl.rb#221 - def ConstantOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#212 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ClassVariableOperatorWriteNode) + end + def class_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - # Create a new ConstantPathAndWriteNode node + # Create a new ClassVariableOrWriteNode node. # - # source://prism//lib/prism/dsl.rb#226 - def ConstantPathAndWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#217 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ClassVariableOrWriteNode) + end + def class_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ConstantPathNode node + # Create a new ClassVariableReadNode node. # - # source://prism//lib/prism/dsl.rb#231 - def ConstantPathNode(parent, name, delimiter_loc, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#222 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ClassVariableReadNode) + end + def class_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new ConstantPathOperatorWriteNode node + # Create a new ClassVariableTargetNode node. # - # source://prism//lib/prism/dsl.rb#236 - def ConstantPathOperatorWriteNode(target, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#227 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ClassVariableTargetNode) + end + def class_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new ConstantPathOrWriteNode node + # Create a new ClassVariableWriteNode node. # - # source://prism//lib/prism/dsl.rb#241 - def ConstantPathOrWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#232 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::ClassVariableWriteNode) + end + def class_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new ConstantPathTargetNode node + # Create a new ConstantAndWriteNode node. # - # source://prism//lib/prism/dsl.rb#246 - def ConstantPathTargetNode(parent, name, delimiter_loc, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#237 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantAndWriteNode) + end + def constant_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ConstantPathWriteNode node + # Create a new ConstantOperatorWriteNode node. # - # source://prism//lib/prism/dsl.rb#251 - def ConstantPathWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#242 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ConstantOperatorWriteNode) + end + def constant_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - # Create a new ConstantReadNode node + # Create a new ConstantOrWriteNode node. # - # source://prism//lib/prism/dsl.rb#256 - def ConstantReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#247 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantOrWriteNode) + end + def constant_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ConstantTargetNode node + # Create a new ConstantPathAndWriteNode node. # - # source://prism//lib/prism/dsl.rb#261 - def ConstantTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#252 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathAndWriteNode) + end + def constant_path_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ConstantWriteNode node + # Create a new ConstantPathNode node. # - # source://prism//lib/prism/dsl.rb#266 - def ConstantWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#257 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location + ).returns(Prism::ConstantPathNode) + end + def constant_path_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end - # Create a new DefNode node + # Create a new ConstantPathOperatorWriteNode node. # - # source://prism//lib/prism/dsl.rb#271 - def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#262 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ConstantPathOperatorWriteNode) + end + def constant_path_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - # Create a new DefinedNode node + # Create a new ConstantPathOrWriteNode node. # - # source://prism//lib/prism/dsl.rb#276 - def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#267 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathOrWriteNode) + end + def constant_path_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ElseNode node + # Create a new ConstantPathTargetNode node. # - # source://prism//lib/prism/dsl.rb#281 - def ElseNode(else_keyword_loc, statements, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#272 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location + ).returns(Prism::ConstantPathTargetNode) + end + def constant_path_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end - # Create a new EmbeddedStatementsNode node + # Create a new ConstantPathWriteNode node. # - # source://prism//lib/prism/dsl.rb#286 - def EmbeddedStatementsNode(opening_loc, statements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#277 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathWriteNode) + end + def constant_path_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new EmbeddedVariableNode node + # Create a new ConstantReadNode node. # - # source://prism//lib/prism/dsl.rb#291 - def EmbeddedVariableNode(operator_loc, variable, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#282 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ConstantReadNode) + end + def constant_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end + + # Create a new ConstantTargetNode node. + # + # source://prism//lib/prism/dsl.rb#287 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ConstantTargetNode) + end + def constant_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end + + # Create a new ConstantWriteNode node. + # + # source://prism//lib/prism/dsl.rb#292 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::ConstantWriteNode) + end + def constant_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end + + # Create a new DefNode node. + # + # source://prism//lib/prism/dsl.rb#297 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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) + ).returns(Prism::DefNode) + end + def def_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), receiver: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), locals: T.unsafe(nil), def_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end + + # Create a new DefinedNode node. + # + # source://prism//lib/prism/dsl.rb#302 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location + ).returns(Prism::DefinedNode) + end + def defined_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end + + # Create a new ElseNode node. + # + # source://prism//lib/prism/dsl.rb#307 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::ElseNode) + end + def else_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end + + # Create a new EmbeddedStatementsNode node. + # + # source://prism//lib/prism/dsl.rb#312 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location + ).returns(Prism::EmbeddedStatementsNode) + end + def embedded_statements_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end + + # Create a new EmbeddedVariableNode node. + # + # source://prism//lib/prism/dsl.rb#317 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + variable: Prism::Node + ).returns(Prism::EmbeddedVariableNode) + end + def embedded_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), variable: T.unsafe(nil)); end + + # Retrieve the value of one of the EncodingFlags flags. + # + # source://prism//lib/prism/dsl.rb#861 + sig { params(name: Symbol).returns(Integer) } + def encoding_flag(name); end + + # Create a new EnsureNode node. + # + # source://prism//lib/prism/dsl.rb#322 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location + ).returns(Prism::EnsureNode) + end + def ensure_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end + + # Create a new FalseNode node. + # + # source://prism//lib/prism/dsl.rb#327 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::FalseNode) + end + def false_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end + + # Create a new FindPatternNode node. + # + # source://prism//lib/prism/dsl.rb#332 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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) + ).returns(Prism::FindPatternNode) + end + def find_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), left: T.unsafe(nil), requireds: T.unsafe(nil), right: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end + + # Create a new FlipFlopNode node. + # + # source://prism//lib/prism/dsl.rb#337 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::FlipFlopNode) + end + def flip_flop_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end + + # Create a new FloatNode node. + # + # source://prism//lib/prism/dsl.rb#342 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Float + ).returns(Prism::FloatNode) + end + def float_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end + + # Create a new ForNode node. + # + # source://prism//lib/prism/dsl.rb#347 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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 + ).returns(Prism::ForNode) + end + def for_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), index: T.unsafe(nil), collection: T.unsafe(nil), statements: T.unsafe(nil), for_keyword_loc: T.unsafe(nil), in_keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end + + # Create a new ForwardingArgumentsNode node. + # + # source://prism//lib/prism/dsl.rb#352 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ForwardingArgumentsNode) + end + def forwarding_arguments_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end + + # Create a new ForwardingParameterNode node. + # + # source://prism//lib/prism/dsl.rb#357 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ForwardingParameterNode) + end + def forwarding_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end + + # Create a new ForwardingSuperNode node. + # + # source://prism//lib/prism/dsl.rb#362 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + block: T.nilable(Prism::BlockNode) + ).returns(Prism::ForwardingSuperNode) + end + def forwarding_super_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), block: T.unsafe(nil)); end + + # Create a new GlobalVariableAndWriteNode node. + # + # source://prism//lib/prism/dsl.rb#367 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::GlobalVariableAndWriteNode) + end + def global_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end + + # Create a new GlobalVariableOperatorWriteNode node. + # + # source://prism//lib/prism/dsl.rb#372 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::GlobalVariableOperatorWriteNode) + end + def global_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - # Create a new EnsureNode node + # Create a new GlobalVariableOrWriteNode node. # - # source://prism//lib/prism/dsl.rb#296 - def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#377 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::GlobalVariableOrWriteNode) + end + def global_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new FalseNode node + # Create a new GlobalVariableReadNode node. # - # source://prism//lib/prism/dsl.rb#301 - def FalseNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#382 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::GlobalVariableReadNode) + end + def global_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new FindPatternNode node + # Create a new GlobalVariableTargetNode node. # - # source://prism//lib/prism/dsl.rb#306 - def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#387 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::GlobalVariableTargetNode) + end + def global_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end + + # Create a new GlobalVariableWriteNode node. + # + # source://prism//lib/prism/dsl.rb#392 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::GlobalVariableWriteNode) + end + def global_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end + + # Create a new HashNode node. + # + # source://prism//lib/prism/dsl.rb#397 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location + ).returns(Prism::HashNode) + end + def hash_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end + + # Create a new HashPatternNode node. + # + # source://prism//lib/prism/dsl.rb#402 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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) + ).returns(Prism::HashPatternNode) + end + def hash_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end + + # Create a new IfNode node. + # + # source://prism//lib/prism/dsl.rb#407 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + if_keyword_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + subsequent: T.nilable(T.any(Prism::ElseNode, Prism::IfNode)), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::IfNode) + end + def if_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - # Create a new FlipFlopNode node + # Create a new ImaginaryNode node. # - # source://prism//lib/prism/dsl.rb#311 - def FlipFlopNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#412 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode) + ).returns(Prism::ImaginaryNode) + end + def imaginary_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numeric: T.unsafe(nil)); end - # Create a new FloatNode node + # Create a new ImplicitNode node. # - # source://prism//lib/prism/dsl.rb#316 - def FloatNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#417 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node + ).returns(Prism::ImplicitNode) + end + def implicit_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ForNode node + # Create a new ImplicitRestNode node. # - # source://prism//lib/prism/dsl.rb#321 - def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#422 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ImplicitRestNode) + end + def implicit_rest_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new ForwardingArgumentsNode node + # Create a new InNode node. # - # source://prism//lib/prism/dsl.rb#326 - def ForwardingArgumentsNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#427 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location) + ).returns(Prism::InNode) + end + def in_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil)); end - # Create a new ForwardingParameterNode node + # Create a new IndexAndWriteNode node. # - # source://prism//lib/prism/dsl.rb#331 - def ForwardingParameterNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#432 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + 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 + ).returns(Prism::IndexAndWriteNode) + end + def index_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ForwardingSuperNode node + # Create a new IndexOperatorWriteNode node. # - # source://prism//lib/prism/dsl.rb#336 - def ForwardingSuperNode(block, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#437 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + 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), + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::IndexOperatorWriteNode) + end + def index_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new GlobalVariableAndWriteNode node + # Create a new IndexOrWriteNode node. # - # source://prism//lib/prism/dsl.rb#341 - def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#442 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + 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 + ).returns(Prism::IndexOrWriteNode) + end + def index_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new GlobalVariableOperatorWriteNode node + # Create a new IndexTargetNode node. # - # source://prism//lib/prism/dsl.rb#346 - def GlobalVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#447 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: Prism::Node, + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node) + ).returns(Prism::IndexTargetNode) + end + def index_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end - # Create a new GlobalVariableOrWriteNode node + # Create a new InstanceVariableAndWriteNode node. # - # source://prism//lib/prism/dsl.rb#351 - def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#452 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::InstanceVariableAndWriteNode) + end + def instance_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new GlobalVariableReadNode node + # Create a new InstanceVariableOperatorWriteNode node. # - # source://prism//lib/prism/dsl.rb#356 - def GlobalVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#457 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::InstanceVariableOperatorWriteNode) + end + def instance_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - # Create a new GlobalVariableTargetNode node + # Create a new InstanceVariableOrWriteNode node. # - # source://prism//lib/prism/dsl.rb#361 - def GlobalVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#462 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::InstanceVariableOrWriteNode) + end + def instance_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new GlobalVariableWriteNode node + # Create a new InstanceVariableReadNode node. # - # source://prism//lib/prism/dsl.rb#366 - def GlobalVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#467 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::InstanceVariableReadNode) + end + def instance_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new HashNode node + # Create a new InstanceVariableTargetNode node. # - # source://prism//lib/prism/dsl.rb#371 - def HashNode(opening_loc, elements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#472 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::InstanceVariableTargetNode) + end + def instance_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new HashPatternNode node + # Create a new InstanceVariableWriteNode node. # - # source://prism//lib/prism/dsl.rb#376 - def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#477 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::InstanceVariableWriteNode) + end + def instance_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new IfNode node + # Retrieve the value of one of the IntegerBaseFlags flags. # - # source://prism//lib/prism/dsl.rb#381 - def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#870 + sig { params(name: Symbol).returns(Integer) } + def integer_base_flag(name); end - # Create a new ImaginaryNode node + # Create a new IntegerNode node. # - # source://prism//lib/prism/dsl.rb#386 - def ImaginaryNode(numeric, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#482 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Integer + ).returns(Prism::IntegerNode) + end + def integer_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new ImplicitNode node + # Create a new InterpolatedMatchLastLineNode node. # - # source://prism//lib/prism/dsl.rb#391 - def ImplicitNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#487 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedMatchLastLineNode) + end + def interpolated_match_last_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new ImplicitRestNode node + # Create a new InterpolatedRegularExpressionNode node. # - # source://prism//lib/prism/dsl.rb#396 - def ImplicitRestNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#492 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedRegularExpressionNode) + end + def interpolated_regular_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new InNode node + # Create a new InterpolatedStringNode node. # - # source://prism//lib/prism/dsl.rb#401 - def InNode(pattern, statements, in_loc, then_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#497 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + 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) + ).returns(Prism::InterpolatedStringNode) + end + def interpolated_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new IndexAndWriteNode node + # Retrieve the value of one of the InterpolatedStringNodeFlags flags. # - # source://prism//lib/prism/dsl.rb#406 - def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#881 + sig { params(name: Symbol).returns(Integer) } + def interpolated_string_node_flag(name); end - # Create a new IndexOperatorWriteNode node + # Create a new InterpolatedSymbolNode node. # - # source://prism//lib/prism/dsl.rb#411 - def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#502 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::InterpolatedSymbolNode) + end + def interpolated_symbol_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new IndexOrWriteNode node + # Create a new InterpolatedXStringNode node. # - # source://prism//lib/prism/dsl.rb#416 - def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#507 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedXStringNode) + end + def interpolated_x_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new IndexTargetNode node + # Create a new ItLocalVariableReadNode node. # - # source://prism//lib/prism/dsl.rb#421 - def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#512 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ItLocalVariableReadNode) + end + def it_local_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new InstanceVariableAndWriteNode node + # Create a new ItParametersNode node. # - # source://prism//lib/prism/dsl.rb#426 - def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#517 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ItParametersNode) + end + def it_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new InstanceVariableOperatorWriteNode node + # Create a new KeywordHashNode node. # - # source://prism//lib/prism/dsl.rb#431 - def InstanceVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#522 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)] + ).returns(Prism::KeywordHashNode) + end + def keyword_hash_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil)); end - # Create a new InstanceVariableOrWriteNode node + # Retrieve the value of one of the KeywordHashNodeFlags flags. # - # source://prism//lib/prism/dsl.rb#436 - def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#890 + sig { params(name: Symbol).returns(Integer) } + def keyword_hash_node_flag(name); end - # Create a new InstanceVariableReadNode node + # Create a new KeywordRestParameterNode node. # - # source://prism//lib/prism/dsl.rb#441 - def InstanceVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#527 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::KeywordRestParameterNode) + end + def keyword_rest_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new InstanceVariableTargetNode node + # Create a new LambdaNode node. # - # source://prism//lib/prism/dsl.rb#446 - def InstanceVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#532 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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) + ).returns(Prism::LambdaNode) + end + def lambda_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil)); end - # Create a new InstanceVariableWriteNode node + # Create a new LocalVariableAndWriteNode node. # - # source://prism//lib/prism/dsl.rb#451 - def InstanceVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#537 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableAndWriteNode) + end + def local_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - # Create a new IntegerNode node + # Create a new LocalVariableOperatorWriteNode node. # - # source://prism//lib/prism/dsl.rb#456 - def IntegerNode(flags, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#542 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + binary_operator: Symbol, + depth: Integer + ).returns(Prism::LocalVariableOperatorWriteNode) + end + def local_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil)); end - # Create a new InterpolatedMatchLastLineNode node + # Create a new LocalVariableOrWriteNode node. # - # source://prism//lib/prism/dsl.rb#461 - def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#547 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableOrWriteNode) + end + def local_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - # Create a new InterpolatedRegularExpressionNode node + # Create a new LocalVariableReadNode node. # - # source://prism//lib/prism/dsl.rb#466 - def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#552 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableReadNode) + end + def local_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - # Create a new InterpolatedStringNode node + # Create a new LocalVariableTargetNode node. # - # source://prism//lib/prism/dsl.rb#471 - def InterpolatedStringNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#557 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableTargetNode) + end + def local_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - # Create a new InterpolatedSymbolNode node + # Create a new LocalVariableWriteNode node. # - # source://prism//lib/prism/dsl.rb#476 - def InterpolatedSymbolNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#562 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::LocalVariableWriteNode) + end + def local_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new InterpolatedXStringNode node + # Create a new Location object. # - # source://prism//lib/prism/dsl.rb#481 - def InterpolatedXStringNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#72 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).returns(Prism::Location) } + def location(source: T.unsafe(nil), start_offset: T.unsafe(nil), length: T.unsafe(nil)); end - # Create a new ItLocalVariableReadNode node + # Retrieve the value of one of the LoopFlags flags. # - # source://prism//lib/prism/dsl.rb#486 - def ItLocalVariableReadNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#898 + sig { params(name: Symbol).returns(Integer) } + def loop_flag(name); end - # Create a new ItParametersNode node + # Create a new MatchLastLineNode node. # - # source://prism//lib/prism/dsl.rb#491 - def ItParametersNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#567 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::MatchLastLineNode) + end + def match_last_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - # Create a new KeywordHashNode node + # Create a new MatchPredicateNode node. # - # source://prism//lib/prism/dsl.rb#496 - def KeywordHashNode(flags, elements, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#572 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::MatchPredicateNode) + end + def match_predicate_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new KeywordRestParameterNode node + # Create a new MatchRequiredNode node. # - # source://prism//lib/prism/dsl.rb#501 - def KeywordRestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#577 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::MatchRequiredNode) + end + def match_required_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new LambdaNode node + # Create a new MatchWriteNode node. # - # source://prism//lib/prism/dsl.rb#506 - def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#582 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode] + ).returns(Prism::MatchWriteNode) + end + def match_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), call: T.unsafe(nil), targets: T.unsafe(nil)); end - # Create a new LocalVariableAndWriteNode node + # Create a new MissingNode node. # - # source://prism//lib/prism/dsl.rb#511 - def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#587 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::MissingNode) + end + def missing_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new LocalVariableOperatorWriteNode node + # Create a new ModuleNode node. # - # source://prism//lib/prism/dsl.rb#516 - def LocalVariableOperatorWriteNode(name_loc, binary_operator_loc, value, name, binary_operator, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#592 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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 + ).returns(Prism::ModuleNode) + end + def module_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), module_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new LocalVariableOrWriteNode node + # Create a new MultiTargetNode node. # - # source://prism//lib/prism/dsl.rb#521 - def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#597 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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(T.any(Prism::ImplicitRestNode, Prism::SplatNode)), + 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) + ).returns(Prism::MultiTargetNode) + end + def multi_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - # Create a new LocalVariableReadNode node + # Create a new MultiWriteNode node. # - # source://prism//lib/prism/dsl.rb#526 - def LocalVariableReadNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#602 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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(T.any(Prism::ImplicitRestNode, Prism::SplatNode)), + 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 + ).returns(Prism::MultiWriteNode) + end + def multi_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new LocalVariableTargetNode node + # Create a new NextNode node. # - # source://prism//lib/prism/dsl.rb#531 - def LocalVariableTargetNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#607 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location + ).returns(Prism::NextNode) + end + def next_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - # Create a new LocalVariableWriteNode node + # Create a new NilNode node. # - # source://prism//lib/prism/dsl.rb#536 - def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#612 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::NilNode) + end + def nil_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new Location object + # Create a new NoKeywordsParameterNode node. # - # source://prism//lib/prism/dsl.rb#46 - def Location(source = T.unsafe(nil), start_offset = T.unsafe(nil), length = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#617 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + keyword_loc: Prism::Location + ).returns(Prism::NoKeywordsParameterNode) + end + def no_keywords_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - # Create a new MatchLastLineNode node + # Create a new NumberedParametersNode node. # - # source://prism//lib/prism/dsl.rb#541 - def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#622 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + maximum: Integer + ).returns(Prism::NumberedParametersNode) + end + def numbered_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), maximum: T.unsafe(nil)); end - # Create a new MatchPredicateNode node + # Create a new NumberedReferenceReadNode node. # - # source://prism//lib/prism/dsl.rb#546 - def MatchPredicateNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#627 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + number: Integer + ).returns(Prism::NumberedReferenceReadNode) + end + def numbered_reference_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), number: T.unsafe(nil)); end - # Create a new MatchRequiredNode node + # Create a new OptionalKeywordParameterNode node. # - # source://prism//lib/prism/dsl.rb#551 - def MatchRequiredNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#632 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::OptionalKeywordParameterNode) + end + def optional_keyword_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new MatchWriteNode node + # Create a new OptionalParameterNode node. # - # source://prism//lib/prism/dsl.rb#556 - def MatchWriteNode(call, targets, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#637 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::OptionalParameterNode) + end + def optional_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - # Create a new MissingNode node + # Create a new OrNode node. # - # source://prism//lib/prism/dsl.rb#561 - def MissingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#642 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::OrNode) + end + def or_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new ModuleNode node + # Retrieve the value of one of the ParameterFlags flags. # - # source://prism//lib/prism/dsl.rb#566 - def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#906 + sig { params(name: Symbol).returns(Integer) } + def parameter_flag(name); end - # Create a new MultiTargetNode node + # Create a new ParametersNode node. # - # source://prism//lib/prism/dsl.rb#571 - def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#647 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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, Prism::ForwardingParameterNode)], + 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) + ).returns(Prism::ParametersNode) + end + def parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), requireds: T.unsafe(nil), optionals: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), keywords: T.unsafe(nil), keyword_rest: T.unsafe(nil), block: T.unsafe(nil)); end - # Create a new MultiWriteNode node + # Create a new ParenthesesNode node. # - # source://prism//lib/prism/dsl.rb#576 - def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#652 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::ParenthesesNode) + end + def parentheses_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new NextNode node + # Create a new PinnedExpressionNode node. # - # source://prism//lib/prism/dsl.rb#581 - def NextNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#657 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location + ).returns(Prism::PinnedExpressionNode) + end + def pinned_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - # Create a new NilNode node + # Create a new PinnedVariableNode node. # - # source://prism//lib/prism/dsl.rb#586 - def NilNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#662 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + variable: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::PinnedVariableNode) + end + def pinned_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), variable: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new NoKeywordsParameterNode node + # Create a new PostExecutionNode node. # - # source://prism//lib/prism/dsl.rb#591 - def NoKeywordsParameterNode(operator_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#667 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::PostExecutionNode) + end + def post_execution_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new NumberedParametersNode node + # Create a new PreExecutionNode node. # - # source://prism//lib/prism/dsl.rb#596 - def NumberedParametersNode(maximum, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#672 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::PreExecutionNode) + end + def pre_execution_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - # Create a new NumberedReferenceReadNode node + # Create a new ProgramNode node. # - # source://prism//lib/prism/dsl.rb#601 - def NumberedReferenceReadNode(number, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#677 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + statements: Prism::StatementsNode + ).returns(Prism::ProgramNode) + end + def program_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), statements: T.unsafe(nil)); end - # Create a new OptionalKeywordParameterNode node + # Retrieve the value of one of the RangeFlags flags. # - # source://prism//lib/prism/dsl.rb#606 - def OptionalKeywordParameterNode(flags, name, name_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#914 + sig { params(name: Symbol).returns(Integer) } + def range_flag(name); end - # Create a new OptionalParameterNode node + # Create a new RangeNode node. # - # source://prism//lib/prism/dsl.rb#611 - def OptionalParameterNode(flags, name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#682 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::RangeNode) + end + def range_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new OrNode node + # Create a new RationalNode node. # - # source://prism//lib/prism/dsl.rb#616 - def OrNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#687 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + numerator: Integer, + denominator: Integer + ).returns(Prism::RationalNode) + end + def rational_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil)); end - # Create a new ParametersNode node + # Create a new RedoNode node. # - # source://prism//lib/prism/dsl.rb#621 - def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#692 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::RedoNode) + end + def redo_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new ParenthesesNode node + # Retrieve the value of one of the RegularExpressionFlags flags. # - # source://prism//lib/prism/dsl.rb#626 - def ParenthesesNode(body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#922 + sig { params(name: Symbol).returns(Integer) } + def regular_expression_flag(name); end - # Create a new PinnedExpressionNode node + # Create a new RegularExpressionNode node. # - # source://prism//lib/prism/dsl.rb#631 - def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#697 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::RegularExpressionNode) + end + def regular_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - # Create a new PinnedVariableNode node + # Create a new RequiredKeywordParameterNode node. # - # source://prism//lib/prism/dsl.rb#636 - def PinnedVariableNode(variable, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#702 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location + ).returns(Prism::RequiredKeywordParameterNode) + end + def required_keyword_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil)); end - # Create a new PostExecutionNode node + # Create a new RequiredParameterNode node. # - # source://prism//lib/prism/dsl.rb#641 - def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#707 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::RequiredParameterNode) + end + def required_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - # Create a new PreExecutionNode node + # Create a new RescueModifierNode node. # - # source://prism//lib/prism/dsl.rb#646 - def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#712 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node + ).returns(Prism::RescueModifierNode) + end + def rescue_modifier_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil)); end - # Create a new ProgramNode node + # Create a new RescueNode node. # - # source://prism//lib/prism/dsl.rb#651 - def ProgramNode(locals, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#717 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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), + subsequent: T.nilable(Prism::RescueNode) + ).returns(Prism::RescueNode) + end + def rescue_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil)); end - # Create a new RangeNode node + # Create a new RestParameterNode node. # - # source://prism//lib/prism/dsl.rb#656 - def RangeNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#722 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::RestParameterNode) + end + def rest_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - # Create a new RationalNode node + # Create a new RetryNode node. # - # source://prism//lib/prism/dsl.rb#661 - def RationalNode(flags, numerator, denominator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#727 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::RetryNode) + end + def retry_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new RedoNode node + # Create a new ReturnNode node. # - # source://prism//lib/prism/dsl.rb#666 - def RedoNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#732 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode) + ).returns(Prism::ReturnNode) + end + def return_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil)); end - # Create a new RegularExpressionNode node + # Create a new SelfNode node. # - # source://prism//lib/prism/dsl.rb#671 - def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#737 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::SelfNode) + end + def self_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new RequiredKeywordParameterNode node + # Create a new ShareableConstantNode node. # - # source://prism//lib/prism/dsl.rb#676 - def RequiredKeywordParameterNode(flags, name, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#742 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode) + ).returns(Prism::ShareableConstantNode) + end + def shareable_constant_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), write: T.unsafe(nil)); end - # Create a new RequiredParameterNode node + # Retrieve the value of one of the ShareableConstantNodeFlags flags. # - # source://prism//lib/prism/dsl.rb#681 - def RequiredParameterNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#940 + sig { params(name: Symbol).returns(Integer) } + def shareable_constant_node_flag(name); end - # Create a new RescueModifierNode node + # Create a new SingletonClassNode node. # - # source://prism//lib/prism/dsl.rb#686 - def RescueModifierNode(expression, keyword_loc, rescue_expression, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#747 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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 + ).returns(Prism::SingletonClassNode) + end + def singleton_class_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - # Create a new RescueNode node + # Create a new Source object. # - # source://prism//lib/prism/dsl.rb#691 - def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#67 + sig { params(string: String).returns(Prism::Source) } + def source(string); end - # Create a new RestParameterNode node + # Create a new SourceEncodingNode node. # - # source://prism//lib/prism/dsl.rb#696 - def RestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#752 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::SourceEncodingNode) + end + def source_encoding_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new RetryNode node + # Create a new SourceFileNode node. # - # source://prism//lib/prism/dsl.rb#701 - def RetryNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#757 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + filepath: String + ).returns(Prism::SourceFileNode) + end + def source_file_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), filepath: T.unsafe(nil)); end - # Create a new ReturnNode node + # Create a new SourceLineNode node. # - # source://prism//lib/prism/dsl.rb#706 - def ReturnNode(flags, keyword_loc, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#762 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::SourceLineNode) + end + def source_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new SelfNode node + # Create a new SplatNode node. # - # source://prism//lib/prism/dsl.rb#711 - def SelfNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#767 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node) + ).returns(Prism::SplatNode) + end + def splat_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil)); end - # Create a new ShareableConstantNode node + # Create a new StatementsNode node. # - # source://prism//lib/prism/dsl.rb#716 - def ShareableConstantNode(flags, write, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#772 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + body: T::Array[Prism::Node] + ).returns(Prism::StatementsNode) + end + def statements_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil)); end - # Create a new SingletonClassNode node + # Retrieve the value of one of the StringFlags flags. # - # source://prism//lib/prism/dsl.rb#721 - def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#950 + sig { params(name: Symbol).returns(Integer) } + def string_flag(name); end - # Create a new SourceEncodingNode node + # Create a new StringNode node. # - # source://prism//lib/prism/dsl.rb#726 - def SourceEncodingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#777 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String + ).returns(Prism::StringNode) + end + def string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - # Create a new SourceFileNode node + # Create a new SuperNode node. # - # source://prism//lib/prism/dsl.rb#731 - def SourceFileNode(flags, filepath, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#782 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + 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) + ).returns(Prism::SuperNode) + end + def super_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil)); end - # Create a new SourceLineNode node + # Retrieve the value of one of the SymbolFlags flags. # - # source://prism//lib/prism/dsl.rb#736 - def SourceLineNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#961 + sig { params(name: Symbol).returns(Integer) } + def symbol_flag(name); end - # Create a new SplatNode node + # Create a new SymbolNode node. # - # source://prism//lib/prism/dsl.rb#741 - def SplatNode(operator_loc, expression, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#787 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + value_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + unescaped: String + ).returns(Prism::SymbolNode) + end + def symbol_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - # Create a new StatementsNode node + # Create a new TrueNode node. # - # source://prism//lib/prism/dsl.rb#746 - def StatementsNode(body, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#792 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::TrueNode) + end + def true_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - # Create a new StringNode node + # Create a new UndefNode node. # - # source://prism//lib/prism/dsl.rb#751 - def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#797 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location + ).returns(Prism::UndefNode) + end + def undef_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), names: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - # Create a new SuperNode node + # Create a new UnlessNode node. # - # source://prism//lib/prism/dsl.rb#756 - def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#802 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + else_clause: T.nilable(Prism::ElseNode), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::UnlessNode) + end + def unless_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), else_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - # Create a new SymbolNode node + # Create a new UntilNode node. # - # source://prism//lib/prism/dsl.rb#761 - def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#807 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::UntilNode) + end + def until_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end - # Create a new TrueNode node + # Create a new WhenNode node. # - # source://prism//lib/prism/dsl.rb#766 - def TrueNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#812 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::WhenNode) + end + def when_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil)); end - # Create a new UndefNode node + # Create a new WhileNode node. # - # source://prism//lib/prism/dsl.rb#771 - def UndefNode(names, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#817 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::WhileNode) + end + def while_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end - # Create a new UnlessNode node + # Create a new XStringNode node. # - # source://prism//lib/prism/dsl.rb#776 - def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#822 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::XStringNode) + end + def x_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - # Create a new UntilNode node + # Create a new YieldNode node. # - # source://prism//lib/prism/dsl.rb#781 - def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#827 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location) + ).returns(Prism::YieldNode) + end + def yield_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - # Create a new WhenNode node - # - # source://prism//lib/prism/dsl.rb#786 - def WhenNode(keyword_loc, conditions, then_keyword_loc, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + private - # Create a new WhileNode node + # The default location object that gets attached to nodes if no location is + # specified, which uses the given source. # - # source://prism//lib/prism/dsl.rb#791 - def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#980 + sig { returns(Prism::Location) } + def default_location; end - # Create a new XStringNode node + # The default node that gets attached to nodes if no node is specified for a + # required node field. # - # source://prism//lib/prism/dsl.rb#796 - def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#986 + sig { params(source: Prism::Source, location: Prism::Location).returns(Prism::Node) } + def default_node(source, location); end - # Create a new YieldNode node + # The default source object that gets attached to nodes and locations if no + # source is specified. # - # source://prism//lib/prism/dsl.rb#801 - def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#974 + sig { returns(Prism::Source) } + def default_source; end end # Represents a method definition. @@ -9287,138 +9372,90 @@ end # end # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#5793 +# source://prism//lib/prism/node.rb#5100 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 + # Initialize a new DefNode node. # # @return [DefNode] a new instance of DefNode # - # source://prism//lib/prism/node.rb#5795 - 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 + # source://prism//lib/prism/node.rb#5102 + def initialize(source, node_id, location, flags, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc); end # 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#6008 + # source://prism//lib/prism/node.rb#5299 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5813 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#5122 def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#5866 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#5175 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5818 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5127 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5832 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5141 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5823 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5132 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?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?) -> DefNode # - # source://prism//lib/prism/node.rb#5837 - 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 + # source://prism//lib/prism/node.rb#5146 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), receiver: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), locals: T.unsafe(nil), def_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5818 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5127 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, 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? } # - # source://prism//lib/prism/node.rb#5845 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5154 def deconstruct_keys(keys); end # def def_keyword: () -> String # - # source://prism//lib/prism/node.rb#5944 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5253 def def_keyword; end # attr_reader def_keyword_loc: Location # - # source://prism//lib/prism/node.rb#5872 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5181 def def_keyword_loc; end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#5969 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#5278 def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#5931 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5240 def end_keyword_loc; end # def equal: () -> String? # - # source://prism//lib/prism/node.rb#5964 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#5273 def equal; end # attr_reader equal_loc: Location? # - # source://prism//lib/prism/node.rb#5918 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5227 def equal_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -9426,104 +9463,75 @@ class Prism::DefNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#5974 + # source://prism//lib/prism/node.rb#5283 sig { override.returns(String) } def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#5869 - sig { returns(T::Array[Symbol]) } + # source://prism//lib/prism/node.rb#5178 def locals; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#5954 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#5263 def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#5892 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5201 def lparen_loc; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#5850 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#5159 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#5853 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5162 def name_loc; end # def operator: () -> String? # - # source://prism//lib/prism/node.rb#5949 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#5258 def operator; end # attr_reader operator_loc: Location? # - # source://prism//lib/prism/node.rb#5879 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5188 def operator_loc; end # attr_reader parameters: ParametersNode? # - # source://prism//lib/prism/node.rb#5863 - sig { returns(T.nilable(Prism::ParametersNode)) } + # source://prism//lib/prism/node.rb#5172 def parameters; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#5860 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#5169 def receiver; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#5959 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#5268 def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#5905 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5214 def rparen_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#5992 + # source://prism//lib/prism/node.rb#5288 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#6002 + # source://prism//lib/prism/node.rb#5293 def type; end end end @@ -9533,80 +9541,55 @@ end # defined?(a) # ^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#6030 +# source://prism//lib/prism/node.rb#5321 class Prism::DefinedNode < ::Prism::Node - # def initialize: (Location? lparen_loc, Prism::node value, Location? rparen_loc, Location keyword_loc, Location location) -> void + # Initialize a new DefinedNode node. # # @return [DefinedNode] a new instance of DefinedNode # - # source://prism//lib/prism/node.rb#6032 - 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 + # source://prism//lib/prism/node.rb#5323 + def initialize(source, node_id, location, flags, lparen_loc, value, rparen_loc, keyword_loc); 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#6160 + # source://prism//lib/prism/node.rb#5435 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6042 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#5335 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6047 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5340 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6057 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5350 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6052 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5345 def compact_child_nodes; end - # def copy: (?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location, ?location: Location) -> DefinedNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode # - # source://prism//lib/prism/node.rb#6062 - 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 + # source://prism//lib/prism/node.rb#5355 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6047 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5340 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location } # - # source://prism//lib/prism/node.rb#6070 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5363 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -9614,126 +9597,103 @@ class Prism::DefinedNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#6126 + # source://prism//lib/prism/node.rb#5419 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#6121 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5414 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#6104 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5397 def keyword_loc; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#6111 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#5404 def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#6075 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5368 def lparen_loc; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#6116 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#5409 def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#6091 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5384 def rparen_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#6144 + # source://prism//lib/prism/node.rb#5424 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#6088 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#5381 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#6154 + # source://prism//lib/prism/node.rb#5429 def type; end end end # source://prism//lib/prism/desugar_compiler.rb#4 class Prism::DesugarAndWriteNode + include ::Prism::DSL + # @return [DesugarAndWriteNode] a new instance of DesugarAndWriteNode # - # source://prism//lib/prism/desugar_compiler.rb#7 - def initialize(node, source, read_class, write_class, *arguments); end + # source://prism//lib/prism/desugar_compiler.rb#9 + def initialize(node, default_source, read_class, write_class, **arguments); end # Returns the value of attribute arguments. # - # source://prism//lib/prism/desugar_compiler.rb#5 + # source://prism//lib/prism/desugar_compiler.rb#7 def arguments; end # Desugar `x &&= y` to `x && x = y` # - # source://prism//lib/prism/desugar_compiler.rb#16 + # source://prism//lib/prism/desugar_compiler.rb#18 def compile; end + # Returns the value of attribute default_source. + # + # source://prism//lib/prism/desugar_compiler.rb#7 + def default_source; end + # Returns the value of attribute node. # - # source://prism//lib/prism/desugar_compiler.rb#5 + # source://prism//lib/prism/desugar_compiler.rb#7 def node; end # Returns the value of attribute read_class. # - # source://prism//lib/prism/desugar_compiler.rb#5 + # source://prism//lib/prism/desugar_compiler.rb#7 def read_class; end - # Returns the value of attribute source. - # - # source://prism//lib/prism/desugar_compiler.rb#5 - def source; end - # Returns the value of attribute write_class. # - # source://prism//lib/prism/desugar_compiler.rb#5 + # source://prism//lib/prism/desugar_compiler.rb#7 def write_class; end end # DesugarCompiler is a compiler that desugars Ruby code into a more primitive # form. This is useful for consumers that want to deal with fewer node types. # -# source://prism//lib/prism/desugar_compiler.rb#218 +# source://prism//lib/prism/desugar_compiler.rb#255 class Prism::DesugarCompiler < ::Prism::MutationCompiler # @@foo &&= bar # @@ -9741,7 +9701,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # @@foo && @@foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#224 + # source://prism//lib/prism/desugar_compiler.rb#261 def visit_class_variable_and_write_node(node); end # @@foo += bar @@ -9750,7 +9710,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # @@foo = @@foo + bar # - # source://prism//lib/prism/desugar_compiler.rb#242 + # source://prism//lib/prism/desugar_compiler.rb#279 def visit_class_variable_operator_write_node(node); end # @@foo ||= bar @@ -9759,7 +9719,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?(@@foo) ? @@foo : @@foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#233 + # source://prism//lib/prism/desugar_compiler.rb#270 def visit_class_variable_or_write_node(node); end # Foo &&= bar @@ -9768,7 +9728,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # Foo && Foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#251 + # source://prism//lib/prism/desugar_compiler.rb#288 def visit_constant_and_write_node(node); end # Foo += bar @@ -9777,7 +9737,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # Foo = Foo + bar # - # source://prism//lib/prism/desugar_compiler.rb#269 + # source://prism//lib/prism/desugar_compiler.rb#306 def visit_constant_operator_write_node(node); end # Foo ||= bar @@ -9786,7 +9746,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?(Foo) ? Foo : Foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#260 + # source://prism//lib/prism/desugar_compiler.rb#297 def visit_constant_or_write_node(node); end # $foo &&= bar @@ -9795,7 +9755,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # $foo && $foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#278 + # source://prism//lib/prism/desugar_compiler.rb#315 def visit_global_variable_and_write_node(node); end # $foo += bar @@ -9804,7 +9764,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # $foo = $foo + bar # - # source://prism//lib/prism/desugar_compiler.rb#296 + # source://prism//lib/prism/desugar_compiler.rb#333 def visit_global_variable_operator_write_node(node); end # $foo ||= bar @@ -9813,22 +9773,22 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?($foo) ? $foo : $foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#287 + # source://prism//lib/prism/desugar_compiler.rb#324 def visit_global_variable_or_write_node(node); end # becomes # - # source://prism//lib/prism/desugar_compiler.rb#305 + # source://prism//lib/prism/desugar_compiler.rb#342 def visit_instance_variable_and_write_node(node); end # becomes # - # source://prism//lib/prism/desugar_compiler.rb#323 + # source://prism//lib/prism/desugar_compiler.rb#360 def visit_instance_variable_operator_write_node(node); end # becomes # - # source://prism//lib/prism/desugar_compiler.rb#314 + # source://prism//lib/prism/desugar_compiler.rb#351 def visit_instance_variable_or_write_node(node); end # foo &&= bar @@ -9837,7 +9797,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo && foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#332 + # source://prism//lib/prism/desugar_compiler.rb#369 def visit_local_variable_and_write_node(node); end # foo += bar @@ -9846,7 +9806,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo = foo + bar # - # source://prism//lib/prism/desugar_compiler.rb#350 + # source://prism//lib/prism/desugar_compiler.rb#387 def visit_local_variable_operator_write_node(node); end # foo ||= bar @@ -9855,121 +9815,127 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo || foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#341 + # source://prism//lib/prism/desugar_compiler.rb#378 def visit_local_variable_or_write_node(node); end end -# source://prism//lib/prism/desugar_compiler.rb#63 +# source://prism//lib/prism/desugar_compiler.rb#86 class Prism::DesugarOperatorWriteNode + include ::Prism::DSL + # @return [DesugarOperatorWriteNode] a new instance of DesugarOperatorWriteNode # - # source://prism//lib/prism/desugar_compiler.rb#66 - def initialize(node, source, read_class, write_class, *arguments); end + # source://prism//lib/prism/desugar_compiler.rb#91 + def initialize(node, default_source, read_class, write_class, **arguments); end # Returns the value of attribute arguments. # - # source://prism//lib/prism/desugar_compiler.rb#64 + # source://prism//lib/prism/desugar_compiler.rb#89 def arguments; end # Desugar `x += y` to `x = x + y` # - # source://prism//lib/prism/desugar_compiler.rb#75 + # source://prism//lib/prism/desugar_compiler.rb#100 def compile; end + # Returns the value of attribute default_source. + # + # source://prism//lib/prism/desugar_compiler.rb#89 + def default_source; end + # Returns the value of attribute node. # - # source://prism//lib/prism/desugar_compiler.rb#64 + # source://prism//lib/prism/desugar_compiler.rb#89 def node; end # Returns the value of attribute read_class. # - # source://prism//lib/prism/desugar_compiler.rb#64 + # source://prism//lib/prism/desugar_compiler.rb#89 def read_class; end - # Returns the value of attribute source. - # - # source://prism//lib/prism/desugar_compiler.rb#64 - def source; end - # Returns the value of attribute write_class. # - # source://prism//lib/prism/desugar_compiler.rb#64 + # source://prism//lib/prism/desugar_compiler.rb#89 def write_class; end end -# source://prism//lib/prism/desugar_compiler.rb#27 +# source://prism//lib/prism/desugar_compiler.rb#35 class Prism::DesugarOrWriteDefinedNode + include ::Prism::DSL + # @return [DesugarOrWriteDefinedNode] a new instance of DesugarOrWriteDefinedNode # - # source://prism//lib/prism/desugar_compiler.rb#30 - def initialize(node, source, read_class, write_class, *arguments); end + # source://prism//lib/prism/desugar_compiler.rb#40 + def initialize(node, default_source, read_class, write_class, **arguments); end # Returns the value of attribute arguments. # - # source://prism//lib/prism/desugar_compiler.rb#28 + # source://prism//lib/prism/desugar_compiler.rb#38 def arguments; end # Desugar `x ||= y` to `defined?(x) ? x : x = y` # - # source://prism//lib/prism/desugar_compiler.rb#39 + # source://prism//lib/prism/desugar_compiler.rb#49 def compile; end + # Returns the value of attribute default_source. + # + # source://prism//lib/prism/desugar_compiler.rb#38 + def default_source; end + # Returns the value of attribute node. # - # source://prism//lib/prism/desugar_compiler.rb#28 + # source://prism//lib/prism/desugar_compiler.rb#38 def node; end # Returns the value of attribute read_class. # - # source://prism//lib/prism/desugar_compiler.rb#28 + # source://prism//lib/prism/desugar_compiler.rb#38 def read_class; end - # Returns the value of attribute source. - # - # source://prism//lib/prism/desugar_compiler.rb#28 - def source; end - # Returns the value of attribute write_class. # - # source://prism//lib/prism/desugar_compiler.rb#28 + # source://prism//lib/prism/desugar_compiler.rb#38 def write_class; end end -# source://prism//lib/prism/desugar_compiler.rb#101 +# source://prism//lib/prism/desugar_compiler.rb#130 class Prism::DesugarOrWriteNode + include ::Prism::DSL + # @return [DesugarOrWriteNode] a new instance of DesugarOrWriteNode # - # source://prism//lib/prism/desugar_compiler.rb#104 - def initialize(node, source, read_class, write_class, *arguments); end + # source://prism//lib/prism/desugar_compiler.rb#135 + def initialize(node, default_source, read_class, write_class, **arguments); end # Returns the value of attribute arguments. # - # source://prism//lib/prism/desugar_compiler.rb#102 + # source://prism//lib/prism/desugar_compiler.rb#133 def arguments; end # Desugar `x ||= y` to `x || x = y` # - # source://prism//lib/prism/desugar_compiler.rb#113 + # source://prism//lib/prism/desugar_compiler.rb#144 def compile; end + # Returns the value of attribute default_source. + # + # source://prism//lib/prism/desugar_compiler.rb#133 + def default_source; end + # Returns the value of attribute node. # - # source://prism//lib/prism/desugar_compiler.rb#102 + # source://prism//lib/prism/desugar_compiler.rb#133 def node; end # Returns the value of attribute read_class. # - # source://prism//lib/prism/desugar_compiler.rb#102 + # source://prism//lib/prism/desugar_compiler.rb#133 def read_class; end - # Returns the value of attribute source. - # - # 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#102 + # source://prism//lib/prism/desugar_compiler.rb#133 def write_class; end end @@ -9988,7 +9954,8 @@ end # end # end # -# dispatcher = Dispatcher.new +# listener = OctalListener.new +# dispatcher = Prism::Dispatcher.new # dispatcher.register(listener, :on_integer_node_enter) # # Then, you can walk any number of trees and dispatch events to the listeners: @@ -10004,13 +9971,13 @@ end # integer = result.value.statements.body.first.receiver.receiver # dispatcher.dispatch_once(integer) # -# source://prism//lib/prism/dispatcher.rb#41 +# source://prism//lib/prism/dispatcher.rb#42 class Prism::Dispatcher < ::Prism::Visitor # Initialize a new dispatcher. # # @return [Dispatcher] a new instance of Dispatcher # - # source://prism//lib/prism/dispatcher.rb#46 + # source://prism//lib/prism/dispatcher.rb#47 def initialize; end # Walks `root` dispatching events to all registered listeners. @@ -10024,1693 +9991,1693 @@ class Prism::Dispatcher < ::Prism::Visitor # # def dispatch_once: (Node) -> void # - # source://prism//lib/prism/dispatcher.rb#65 + # source://prism//lib/prism/dispatcher.rb#66 def dispatch_once(node); end # attr_reader listeners: Hash[Symbol, Array[Listener]] # - # source://prism//lib/prism/dispatcher.rb#43 + # source://prism//lib/prism/dispatcher.rb#44 def listeners; end # Register a listener for one or more events. # # def register: (Listener, *Symbol) -> void # - # source://prism//lib/prism/dispatcher.rb#53 + # source://prism//lib/prism/dispatcher.rb#54 def register(listener, *events); end # Dispatch enter and leave events for AliasGlobalVariableNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#71 + # source://prism//lib/prism/dispatcher.rb#72 def visit_alias_global_variable_node(node); end # Dispatch enter and leave events for AliasMethodNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#79 + # source://prism//lib/prism/dispatcher.rb#80 def visit_alias_method_node(node); end # Dispatch enter and leave events for AlternationPatternNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#87 + # source://prism//lib/prism/dispatcher.rb#88 def visit_alternation_pattern_node(node); end # Dispatch enter and leave events for AndNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#95 + # source://prism//lib/prism/dispatcher.rb#96 def visit_and_node(node); end # Dispatch enter and leave events for ArgumentsNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#103 + # source://prism//lib/prism/dispatcher.rb#104 def visit_arguments_node(node); end # Dispatch enter and leave events for ArrayNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#111 + # source://prism//lib/prism/dispatcher.rb#112 def visit_array_node(node); end # Dispatch enter and leave events for ArrayPatternNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#119 + # source://prism//lib/prism/dispatcher.rb#120 def visit_array_pattern_node(node); end # Dispatch enter and leave events for AssocNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#127 + # source://prism//lib/prism/dispatcher.rb#128 def visit_assoc_node(node); end # Dispatch enter and leave events for AssocSplatNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#135 + # source://prism//lib/prism/dispatcher.rb#136 def visit_assoc_splat_node(node); end # Dispatch enter and leave events for BackReferenceReadNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#143 + # source://prism//lib/prism/dispatcher.rb#144 def visit_back_reference_read_node(node); end # Dispatch enter and leave events for BeginNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#151 + # source://prism//lib/prism/dispatcher.rb#152 def visit_begin_node(node); end # Dispatch enter and leave events for BlockArgumentNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#159 + # source://prism//lib/prism/dispatcher.rb#160 def visit_block_argument_node(node); end # Dispatch enter and leave events for BlockLocalVariableNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#167 + # source://prism//lib/prism/dispatcher.rb#168 def visit_block_local_variable_node(node); end # Dispatch enter and leave events for BlockNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#175 + # source://prism//lib/prism/dispatcher.rb#176 def visit_block_node(node); end # Dispatch enter and leave events for BlockParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#183 + # source://prism//lib/prism/dispatcher.rb#184 def visit_block_parameter_node(node); end # Dispatch enter and leave events for BlockParametersNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#191 + # source://prism//lib/prism/dispatcher.rb#192 def visit_block_parameters_node(node); end # Dispatch enter and leave events for BreakNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#199 + # source://prism//lib/prism/dispatcher.rb#200 def visit_break_node(node); end # Dispatch enter and leave events for CallAndWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#207 + # source://prism//lib/prism/dispatcher.rb#208 def visit_call_and_write_node(node); end # Dispatch enter and leave events for CallNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#215 + # source://prism//lib/prism/dispatcher.rb#216 def visit_call_node(node); end # Dispatch enter and leave events for CallOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#223 + # source://prism//lib/prism/dispatcher.rb#224 def visit_call_operator_write_node(node); end # Dispatch enter and leave events for CallOrWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#231 + # source://prism//lib/prism/dispatcher.rb#232 def visit_call_or_write_node(node); end # Dispatch enter and leave events for CallTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#239 + # source://prism//lib/prism/dispatcher.rb#240 def visit_call_target_node(node); end # Dispatch enter and leave events for CapturePatternNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#247 + # source://prism//lib/prism/dispatcher.rb#248 def visit_capture_pattern_node(node); end # Dispatch enter and leave events for CaseMatchNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#255 + # source://prism//lib/prism/dispatcher.rb#256 def visit_case_match_node(node); end # Dispatch enter and leave events for CaseNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#263 + # source://prism//lib/prism/dispatcher.rb#264 def visit_case_node(node); end # Dispatch enter and leave events for ClassNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#271 + # source://prism//lib/prism/dispatcher.rb#272 def visit_class_node(node); end # Dispatch enter and leave events for ClassVariableAndWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#279 + # source://prism//lib/prism/dispatcher.rb#280 def visit_class_variable_and_write_node(node); end # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#287 + # source://prism//lib/prism/dispatcher.rb#288 def visit_class_variable_operator_write_node(node); end # Dispatch enter and leave events for ClassVariableOrWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#295 + # source://prism//lib/prism/dispatcher.rb#296 def visit_class_variable_or_write_node(node); end # Dispatch enter and leave events for ClassVariableReadNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#303 + # source://prism//lib/prism/dispatcher.rb#304 def visit_class_variable_read_node(node); end # Dispatch enter and leave events for ClassVariableTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#311 + # source://prism//lib/prism/dispatcher.rb#312 def visit_class_variable_target_node(node); end # Dispatch enter and leave events for ClassVariableWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#319 + # source://prism//lib/prism/dispatcher.rb#320 def visit_class_variable_write_node(node); end # Dispatch enter and leave events for ConstantAndWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#327 + # source://prism//lib/prism/dispatcher.rb#328 def visit_constant_and_write_node(node); end # Dispatch enter and leave events for ConstantOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#335 + # source://prism//lib/prism/dispatcher.rb#336 def visit_constant_operator_write_node(node); end # Dispatch enter and leave events for ConstantOrWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#343 + # source://prism//lib/prism/dispatcher.rb#344 def visit_constant_or_write_node(node); end # Dispatch enter and leave events for ConstantPathAndWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#351 + # source://prism//lib/prism/dispatcher.rb#352 def visit_constant_path_and_write_node(node); end # Dispatch enter and leave events for ConstantPathNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#359 + # source://prism//lib/prism/dispatcher.rb#360 def visit_constant_path_node(node); end # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#367 + # source://prism//lib/prism/dispatcher.rb#368 def visit_constant_path_operator_write_node(node); end # Dispatch enter and leave events for ConstantPathOrWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#375 + # source://prism//lib/prism/dispatcher.rb#376 def visit_constant_path_or_write_node(node); end # Dispatch enter and leave events for ConstantPathTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#383 + # source://prism//lib/prism/dispatcher.rb#384 def visit_constant_path_target_node(node); end # Dispatch enter and leave events for ConstantPathWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#391 + # source://prism//lib/prism/dispatcher.rb#392 def visit_constant_path_write_node(node); end # Dispatch enter and leave events for ConstantReadNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#399 + # source://prism//lib/prism/dispatcher.rb#400 def visit_constant_read_node(node); end # Dispatch enter and leave events for ConstantTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#407 + # source://prism//lib/prism/dispatcher.rb#408 def visit_constant_target_node(node); end # Dispatch enter and leave events for ConstantWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#415 + # source://prism//lib/prism/dispatcher.rb#416 def visit_constant_write_node(node); end # Dispatch enter and leave events for DefNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#423 + # source://prism//lib/prism/dispatcher.rb#424 def visit_def_node(node); end # Dispatch enter and leave events for DefinedNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#431 + # source://prism//lib/prism/dispatcher.rb#432 def visit_defined_node(node); end # Dispatch enter and leave events for ElseNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#439 + # source://prism//lib/prism/dispatcher.rb#440 def visit_else_node(node); end # Dispatch enter and leave events for EmbeddedStatementsNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#447 + # source://prism//lib/prism/dispatcher.rb#448 def visit_embedded_statements_node(node); end # Dispatch enter and leave events for EmbeddedVariableNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#455 + # source://prism//lib/prism/dispatcher.rb#456 def visit_embedded_variable_node(node); end # Dispatch enter and leave events for EnsureNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#463 + # source://prism//lib/prism/dispatcher.rb#464 def visit_ensure_node(node); end # Dispatch enter and leave events for FalseNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#471 + # source://prism//lib/prism/dispatcher.rb#472 def visit_false_node(node); end # Dispatch enter and leave events for FindPatternNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#479 + # source://prism//lib/prism/dispatcher.rb#480 def visit_find_pattern_node(node); end # Dispatch enter and leave events for FlipFlopNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#487 + # source://prism//lib/prism/dispatcher.rb#488 def visit_flip_flop_node(node); end # Dispatch enter and leave events for FloatNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#495 + # source://prism//lib/prism/dispatcher.rb#496 def visit_float_node(node); end # Dispatch enter and leave events for ForNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#503 + # source://prism//lib/prism/dispatcher.rb#504 def visit_for_node(node); end # Dispatch enter and leave events for ForwardingArgumentsNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#511 + # source://prism//lib/prism/dispatcher.rb#512 def visit_forwarding_arguments_node(node); end # Dispatch enter and leave events for ForwardingParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#519 + # source://prism//lib/prism/dispatcher.rb#520 def visit_forwarding_parameter_node(node); end # Dispatch enter and leave events for ForwardingSuperNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#527 + # source://prism//lib/prism/dispatcher.rb#528 def visit_forwarding_super_node(node); end # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#535 + # source://prism//lib/prism/dispatcher.rb#536 def visit_global_variable_and_write_node(node); end # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#543 + # source://prism//lib/prism/dispatcher.rb#544 def visit_global_variable_operator_write_node(node); end # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#551 + # source://prism//lib/prism/dispatcher.rb#552 def visit_global_variable_or_write_node(node); end # Dispatch enter and leave events for GlobalVariableReadNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#559 + # source://prism//lib/prism/dispatcher.rb#560 def visit_global_variable_read_node(node); end # Dispatch enter and leave events for GlobalVariableTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#567 + # source://prism//lib/prism/dispatcher.rb#568 def visit_global_variable_target_node(node); end # Dispatch enter and leave events for GlobalVariableWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#575 + # source://prism//lib/prism/dispatcher.rb#576 def visit_global_variable_write_node(node); end # Dispatch enter and leave events for HashNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#583 + # source://prism//lib/prism/dispatcher.rb#584 def visit_hash_node(node); end # Dispatch enter and leave events for HashPatternNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#591 + # source://prism//lib/prism/dispatcher.rb#592 def visit_hash_pattern_node(node); end # Dispatch enter and leave events for IfNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#599 + # source://prism//lib/prism/dispatcher.rb#600 def visit_if_node(node); end # Dispatch enter and leave events for ImaginaryNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#607 + # source://prism//lib/prism/dispatcher.rb#608 def visit_imaginary_node(node); end # Dispatch enter and leave events for ImplicitNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#615 + # source://prism//lib/prism/dispatcher.rb#616 def visit_implicit_node(node); end # Dispatch enter and leave events for ImplicitRestNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#623 + # source://prism//lib/prism/dispatcher.rb#624 def visit_implicit_rest_node(node); end # Dispatch enter and leave events for InNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#631 + # source://prism//lib/prism/dispatcher.rb#632 def visit_in_node(node); end # Dispatch enter and leave events for IndexAndWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#639 + # source://prism//lib/prism/dispatcher.rb#640 def visit_index_and_write_node(node); end # Dispatch enter and leave events for IndexOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#647 + # source://prism//lib/prism/dispatcher.rb#648 def visit_index_operator_write_node(node); end # Dispatch enter and leave events for IndexOrWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#655 + # source://prism//lib/prism/dispatcher.rb#656 def visit_index_or_write_node(node); end # Dispatch enter and leave events for IndexTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#663 + # source://prism//lib/prism/dispatcher.rb#664 def visit_index_target_node(node); end # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#671 + # source://prism//lib/prism/dispatcher.rb#672 def visit_instance_variable_and_write_node(node); end # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#679 + # source://prism//lib/prism/dispatcher.rb#680 def visit_instance_variable_operator_write_node(node); end # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#687 + # source://prism//lib/prism/dispatcher.rb#688 def visit_instance_variable_or_write_node(node); end # Dispatch enter and leave events for InstanceVariableReadNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#695 + # source://prism//lib/prism/dispatcher.rb#696 def visit_instance_variable_read_node(node); end # Dispatch enter and leave events for InstanceVariableTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#703 + # source://prism//lib/prism/dispatcher.rb#704 def visit_instance_variable_target_node(node); end # Dispatch enter and leave events for InstanceVariableWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#711 + # source://prism//lib/prism/dispatcher.rb#712 def visit_instance_variable_write_node(node); end # Dispatch enter and leave events for IntegerNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#719 + # source://prism//lib/prism/dispatcher.rb#720 def visit_integer_node(node); end # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#727 + # source://prism//lib/prism/dispatcher.rb#728 def visit_interpolated_match_last_line_node(node); end # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#735 + # source://prism//lib/prism/dispatcher.rb#736 def visit_interpolated_regular_expression_node(node); end # Dispatch enter and leave events for InterpolatedStringNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#743 + # source://prism//lib/prism/dispatcher.rb#744 def visit_interpolated_string_node(node); end # Dispatch enter and leave events for InterpolatedSymbolNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#751 + # source://prism//lib/prism/dispatcher.rb#752 def visit_interpolated_symbol_node(node); end # Dispatch enter and leave events for InterpolatedXStringNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#759 + # source://prism//lib/prism/dispatcher.rb#760 def visit_interpolated_x_string_node(node); end # Dispatch enter and leave events for ItLocalVariableReadNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#767 + # source://prism//lib/prism/dispatcher.rb#768 def visit_it_local_variable_read_node(node); end # Dispatch enter and leave events for ItParametersNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#775 + # source://prism//lib/prism/dispatcher.rb#776 def visit_it_parameters_node(node); end # Dispatch enter and leave events for KeywordHashNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#783 + # source://prism//lib/prism/dispatcher.rb#784 def visit_keyword_hash_node(node); end # Dispatch enter and leave events for KeywordRestParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#791 + # source://prism//lib/prism/dispatcher.rb#792 def visit_keyword_rest_parameter_node(node); end # Dispatch enter and leave events for LambdaNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#799 + # source://prism//lib/prism/dispatcher.rb#800 def visit_lambda_node(node); end # Dispatch enter and leave events for LocalVariableAndWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#807 + # source://prism//lib/prism/dispatcher.rb#808 def visit_local_variable_and_write_node(node); end # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#815 + # source://prism//lib/prism/dispatcher.rb#816 def visit_local_variable_operator_write_node(node); end # Dispatch enter and leave events for LocalVariableOrWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#823 + # source://prism//lib/prism/dispatcher.rb#824 def visit_local_variable_or_write_node(node); end # Dispatch enter and leave events for LocalVariableReadNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#831 + # source://prism//lib/prism/dispatcher.rb#832 def visit_local_variable_read_node(node); end # Dispatch enter and leave events for LocalVariableTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#839 + # source://prism//lib/prism/dispatcher.rb#840 def visit_local_variable_target_node(node); end # Dispatch enter and leave events for LocalVariableWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#847 + # source://prism//lib/prism/dispatcher.rb#848 def visit_local_variable_write_node(node); end # Dispatch enter and leave events for MatchLastLineNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#855 + # source://prism//lib/prism/dispatcher.rb#856 def visit_match_last_line_node(node); end # Dispatch enter and leave events for MatchPredicateNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#863 + # source://prism//lib/prism/dispatcher.rb#864 def visit_match_predicate_node(node); end # Dispatch enter and leave events for MatchRequiredNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#871 + # source://prism//lib/prism/dispatcher.rb#872 def visit_match_required_node(node); end # Dispatch enter and leave events for MatchWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#879 + # source://prism//lib/prism/dispatcher.rb#880 def visit_match_write_node(node); end # Dispatch enter and leave events for MissingNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#887 + # source://prism//lib/prism/dispatcher.rb#888 def visit_missing_node(node); end # Dispatch enter and leave events for ModuleNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#895 + # source://prism//lib/prism/dispatcher.rb#896 def visit_module_node(node); end # Dispatch enter and leave events for MultiTargetNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#903 + # source://prism//lib/prism/dispatcher.rb#904 def visit_multi_target_node(node); end # Dispatch enter and leave events for MultiWriteNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#911 + # source://prism//lib/prism/dispatcher.rb#912 def visit_multi_write_node(node); end # Dispatch enter and leave events for NextNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#919 + # source://prism//lib/prism/dispatcher.rb#920 def visit_next_node(node); end # Dispatch enter and leave events for NilNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#927 + # source://prism//lib/prism/dispatcher.rb#928 def visit_nil_node(node); end # Dispatch enter and leave events for NoKeywordsParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#935 + # source://prism//lib/prism/dispatcher.rb#936 def visit_no_keywords_parameter_node(node); end # Dispatch enter and leave events for NumberedParametersNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#943 + # source://prism//lib/prism/dispatcher.rb#944 def visit_numbered_parameters_node(node); end # Dispatch enter and leave events for NumberedReferenceReadNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#951 + # source://prism//lib/prism/dispatcher.rb#952 def visit_numbered_reference_read_node(node); end # Dispatch enter and leave events for OptionalKeywordParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#959 + # source://prism//lib/prism/dispatcher.rb#960 def visit_optional_keyword_parameter_node(node); end # Dispatch enter and leave events for OptionalParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#967 + # source://prism//lib/prism/dispatcher.rb#968 def visit_optional_parameter_node(node); end # Dispatch enter and leave events for OrNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#975 + # source://prism//lib/prism/dispatcher.rb#976 def visit_or_node(node); end # Dispatch enter and leave events for ParametersNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#983 + # source://prism//lib/prism/dispatcher.rb#984 def visit_parameters_node(node); end # Dispatch enter and leave events for ParenthesesNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#991 + # source://prism//lib/prism/dispatcher.rb#992 def visit_parentheses_node(node); end # Dispatch enter and leave events for PinnedExpressionNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#999 + # source://prism//lib/prism/dispatcher.rb#1000 def visit_pinned_expression_node(node); end # Dispatch enter and leave events for PinnedVariableNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1007 + # source://prism//lib/prism/dispatcher.rb#1008 def visit_pinned_variable_node(node); end # Dispatch enter and leave events for PostExecutionNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1015 + # source://prism//lib/prism/dispatcher.rb#1016 def visit_post_execution_node(node); end # Dispatch enter and leave events for PreExecutionNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1023 + # source://prism//lib/prism/dispatcher.rb#1024 def visit_pre_execution_node(node); end # Dispatch enter and leave events for ProgramNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1031 + # source://prism//lib/prism/dispatcher.rb#1032 def visit_program_node(node); end # Dispatch enter and leave events for RangeNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1039 + # source://prism//lib/prism/dispatcher.rb#1040 def visit_range_node(node); end # Dispatch enter and leave events for RationalNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1047 + # source://prism//lib/prism/dispatcher.rb#1048 def visit_rational_node(node); end # Dispatch enter and leave events for RedoNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1055 + # source://prism//lib/prism/dispatcher.rb#1056 def visit_redo_node(node); end # Dispatch enter and leave events for RegularExpressionNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1063 + # source://prism//lib/prism/dispatcher.rb#1064 def visit_regular_expression_node(node); end # Dispatch enter and leave events for RequiredKeywordParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1071 + # source://prism//lib/prism/dispatcher.rb#1072 def visit_required_keyword_parameter_node(node); end # Dispatch enter and leave events for RequiredParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1079 + # source://prism//lib/prism/dispatcher.rb#1080 def visit_required_parameter_node(node); end # Dispatch enter and leave events for RescueModifierNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1087 + # source://prism//lib/prism/dispatcher.rb#1088 def visit_rescue_modifier_node(node); end # Dispatch enter and leave events for RescueNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1095 + # source://prism//lib/prism/dispatcher.rb#1096 def visit_rescue_node(node); end # Dispatch enter and leave events for RestParameterNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1103 + # source://prism//lib/prism/dispatcher.rb#1104 def visit_rest_parameter_node(node); end # Dispatch enter and leave events for RetryNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1111 + # source://prism//lib/prism/dispatcher.rb#1112 def visit_retry_node(node); end # Dispatch enter and leave events for ReturnNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1119 + # source://prism//lib/prism/dispatcher.rb#1120 def visit_return_node(node); end # Dispatch enter and leave events for SelfNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1127 + # source://prism//lib/prism/dispatcher.rb#1128 def visit_self_node(node); end # Dispatch enter and leave events for ShareableConstantNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1135 + # source://prism//lib/prism/dispatcher.rb#1136 def visit_shareable_constant_node(node); end # Dispatch enter and leave events for SingletonClassNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1143 + # source://prism//lib/prism/dispatcher.rb#1144 def visit_singleton_class_node(node); end # Dispatch enter and leave events for SourceEncodingNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1151 + # source://prism//lib/prism/dispatcher.rb#1152 def visit_source_encoding_node(node); end # Dispatch enter and leave events for SourceFileNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1159 + # source://prism//lib/prism/dispatcher.rb#1160 def visit_source_file_node(node); end # Dispatch enter and leave events for SourceLineNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1167 + # source://prism//lib/prism/dispatcher.rb#1168 def visit_source_line_node(node); end # Dispatch enter and leave events for SplatNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1175 + # source://prism//lib/prism/dispatcher.rb#1176 def visit_splat_node(node); end # Dispatch enter and leave events for StatementsNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1183 + # source://prism//lib/prism/dispatcher.rb#1184 def visit_statements_node(node); end # Dispatch enter and leave events for StringNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1191 + # source://prism//lib/prism/dispatcher.rb#1192 def visit_string_node(node); end # Dispatch enter and leave events for SuperNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1199 + # source://prism//lib/prism/dispatcher.rb#1200 def visit_super_node(node); end # Dispatch enter and leave events for SymbolNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1207 + # source://prism//lib/prism/dispatcher.rb#1208 def visit_symbol_node(node); end # Dispatch enter and leave events for TrueNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1215 + # source://prism//lib/prism/dispatcher.rb#1216 def visit_true_node(node); end # Dispatch enter and leave events for UndefNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1223 + # source://prism//lib/prism/dispatcher.rb#1224 def visit_undef_node(node); end # Dispatch enter and leave events for UnlessNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1231 + # source://prism//lib/prism/dispatcher.rb#1232 def visit_unless_node(node); end # Dispatch enter and leave events for UntilNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1239 + # source://prism//lib/prism/dispatcher.rb#1240 def visit_until_node(node); end # Dispatch enter and leave events for WhenNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1247 + # source://prism//lib/prism/dispatcher.rb#1248 def visit_when_node(node); end # Dispatch enter and leave events for WhileNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1255 + # source://prism//lib/prism/dispatcher.rb#1256 def visit_while_node(node); end # Dispatch enter and leave events for XStringNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1263 + # source://prism//lib/prism/dispatcher.rb#1264 def visit_x_string_node(node); end # Dispatch enter and leave events for YieldNode nodes and continue # walking the tree. # - # source://prism//lib/prism/dispatcher.rb#1271 + # source://prism//lib/prism/dispatcher.rb#1272 def visit_yield_node(node); end end -# source://prism//lib/prism/dispatcher.rb#1277 +# source://prism//lib/prism/dispatcher.rb#1278 class Prism::Dispatcher::DispatchOnce < ::Prism::Visitor # @return [DispatchOnce] a new instance of DispatchOnce # - # source://prism//lib/prism/dispatcher.rb#1280 + # source://prism//lib/prism/dispatcher.rb#1281 def initialize(listeners); end # Returns the value of attribute listeners. # - # source://prism//lib/prism/dispatcher.rb#1278 + # source://prism//lib/prism/dispatcher.rb#1279 def listeners; end # Dispatch enter and leave events for AliasGlobalVariableNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1285 + # source://prism//lib/prism/dispatcher.rb#1286 def visit_alias_global_variable_node(node); end # Dispatch enter and leave events for AliasMethodNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1291 + # source://prism//lib/prism/dispatcher.rb#1292 def visit_alias_method_node(node); end # Dispatch enter and leave events for AlternationPatternNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1297 + # source://prism//lib/prism/dispatcher.rb#1298 def visit_alternation_pattern_node(node); end # Dispatch enter and leave events for AndNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1303 + # source://prism//lib/prism/dispatcher.rb#1304 def visit_and_node(node); end # Dispatch enter and leave events for ArgumentsNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1309 + # source://prism//lib/prism/dispatcher.rb#1310 def visit_arguments_node(node); end # Dispatch enter and leave events for ArrayNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1315 + # source://prism//lib/prism/dispatcher.rb#1316 def visit_array_node(node); end # Dispatch enter and leave events for ArrayPatternNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1321 + # source://prism//lib/prism/dispatcher.rb#1322 def visit_array_pattern_node(node); end # Dispatch enter and leave events for AssocNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1327 + # source://prism//lib/prism/dispatcher.rb#1328 def visit_assoc_node(node); end # Dispatch enter and leave events for AssocSplatNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1333 + # source://prism//lib/prism/dispatcher.rb#1334 def visit_assoc_splat_node(node); end # Dispatch enter and leave events for BackReferenceReadNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1339 + # source://prism//lib/prism/dispatcher.rb#1340 def visit_back_reference_read_node(node); end # Dispatch enter and leave events for BeginNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1345 + # source://prism//lib/prism/dispatcher.rb#1346 def visit_begin_node(node); end # Dispatch enter and leave events for BlockArgumentNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1351 + # source://prism//lib/prism/dispatcher.rb#1352 def visit_block_argument_node(node); end # Dispatch enter and leave events for BlockLocalVariableNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1357 + # source://prism//lib/prism/dispatcher.rb#1358 def visit_block_local_variable_node(node); end # Dispatch enter and leave events for BlockNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1363 + # source://prism//lib/prism/dispatcher.rb#1364 def visit_block_node(node); end # Dispatch enter and leave events for BlockParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1369 + # source://prism//lib/prism/dispatcher.rb#1370 def visit_block_parameter_node(node); end # Dispatch enter and leave events for BlockParametersNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1375 + # source://prism//lib/prism/dispatcher.rb#1376 def visit_block_parameters_node(node); end # Dispatch enter and leave events for BreakNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1381 + # source://prism//lib/prism/dispatcher.rb#1382 def visit_break_node(node); end # Dispatch enter and leave events for CallAndWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1387 + # source://prism//lib/prism/dispatcher.rb#1388 def visit_call_and_write_node(node); end # Dispatch enter and leave events for CallNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1393 + # source://prism//lib/prism/dispatcher.rb#1394 def visit_call_node(node); end # Dispatch enter and leave events for CallOperatorWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1399 + # source://prism//lib/prism/dispatcher.rb#1400 def visit_call_operator_write_node(node); end # Dispatch enter and leave events for CallOrWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1405 + # source://prism//lib/prism/dispatcher.rb#1406 def visit_call_or_write_node(node); end # Dispatch enter and leave events for CallTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1411 + # source://prism//lib/prism/dispatcher.rb#1412 def visit_call_target_node(node); end # Dispatch enter and leave events for CapturePatternNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1417 + # source://prism//lib/prism/dispatcher.rb#1418 def visit_capture_pattern_node(node); end # Dispatch enter and leave events for CaseMatchNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1423 + # source://prism//lib/prism/dispatcher.rb#1424 def visit_case_match_node(node); end # Dispatch enter and leave events for CaseNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1429 + # source://prism//lib/prism/dispatcher.rb#1430 def visit_case_node(node); end # Dispatch enter and leave events for ClassNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1435 + # source://prism//lib/prism/dispatcher.rb#1436 def visit_class_node(node); end # Dispatch enter and leave events for ClassVariableAndWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1441 + # source://prism//lib/prism/dispatcher.rb#1442 def visit_class_variable_and_write_node(node); end # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1447 + # source://prism//lib/prism/dispatcher.rb#1448 def visit_class_variable_operator_write_node(node); end # Dispatch enter and leave events for ClassVariableOrWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1453 + # source://prism//lib/prism/dispatcher.rb#1454 def visit_class_variable_or_write_node(node); end # Dispatch enter and leave events for ClassVariableReadNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1459 + # source://prism//lib/prism/dispatcher.rb#1460 def visit_class_variable_read_node(node); end # Dispatch enter and leave events for ClassVariableTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1465 + # source://prism//lib/prism/dispatcher.rb#1466 def visit_class_variable_target_node(node); end # Dispatch enter and leave events for ClassVariableWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1471 + # source://prism//lib/prism/dispatcher.rb#1472 def visit_class_variable_write_node(node); end # Dispatch enter and leave events for ConstantAndWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1477 + # source://prism//lib/prism/dispatcher.rb#1478 def visit_constant_and_write_node(node); end # Dispatch enter and leave events for ConstantOperatorWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1483 + # source://prism//lib/prism/dispatcher.rb#1484 def visit_constant_operator_write_node(node); end # Dispatch enter and leave events for ConstantOrWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1489 + # source://prism//lib/prism/dispatcher.rb#1490 def visit_constant_or_write_node(node); end # Dispatch enter and leave events for ConstantPathAndWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1495 + # source://prism//lib/prism/dispatcher.rb#1496 def visit_constant_path_and_write_node(node); end # Dispatch enter and leave events for ConstantPathNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1501 + # source://prism//lib/prism/dispatcher.rb#1502 def visit_constant_path_node(node); end # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1507 + # source://prism//lib/prism/dispatcher.rb#1508 def visit_constant_path_operator_write_node(node); end # Dispatch enter and leave events for ConstantPathOrWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1513 + # source://prism//lib/prism/dispatcher.rb#1514 def visit_constant_path_or_write_node(node); end # Dispatch enter and leave events for ConstantPathTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1519 + # source://prism//lib/prism/dispatcher.rb#1520 def visit_constant_path_target_node(node); end # Dispatch enter and leave events for ConstantPathWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1525 + # source://prism//lib/prism/dispatcher.rb#1526 def visit_constant_path_write_node(node); end # Dispatch enter and leave events for ConstantReadNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1531 + # source://prism//lib/prism/dispatcher.rb#1532 def visit_constant_read_node(node); end # Dispatch enter and leave events for ConstantTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1537 + # source://prism//lib/prism/dispatcher.rb#1538 def visit_constant_target_node(node); end # Dispatch enter and leave events for ConstantWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1543 + # source://prism//lib/prism/dispatcher.rb#1544 def visit_constant_write_node(node); end # Dispatch enter and leave events for DefNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1549 + # source://prism//lib/prism/dispatcher.rb#1550 def visit_def_node(node); end # Dispatch enter and leave events for DefinedNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1555 + # source://prism//lib/prism/dispatcher.rb#1556 def visit_defined_node(node); end # Dispatch enter and leave events for ElseNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1561 + # source://prism//lib/prism/dispatcher.rb#1562 def visit_else_node(node); end # Dispatch enter and leave events for EmbeddedStatementsNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1567 + # source://prism//lib/prism/dispatcher.rb#1568 def visit_embedded_statements_node(node); end # Dispatch enter and leave events for EmbeddedVariableNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1573 + # source://prism//lib/prism/dispatcher.rb#1574 def visit_embedded_variable_node(node); end # Dispatch enter and leave events for EnsureNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1579 + # source://prism//lib/prism/dispatcher.rb#1580 def visit_ensure_node(node); end # Dispatch enter and leave events for FalseNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1585 + # source://prism//lib/prism/dispatcher.rb#1586 def visit_false_node(node); end # Dispatch enter and leave events for FindPatternNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1591 + # source://prism//lib/prism/dispatcher.rb#1592 def visit_find_pattern_node(node); end # Dispatch enter and leave events for FlipFlopNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1597 + # source://prism//lib/prism/dispatcher.rb#1598 def visit_flip_flop_node(node); end # Dispatch enter and leave events for FloatNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1603 + # source://prism//lib/prism/dispatcher.rb#1604 def visit_float_node(node); end # Dispatch enter and leave events for ForNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1609 + # source://prism//lib/prism/dispatcher.rb#1610 def visit_for_node(node); end # Dispatch enter and leave events for ForwardingArgumentsNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1615 + # source://prism//lib/prism/dispatcher.rb#1616 def visit_forwarding_arguments_node(node); end # Dispatch enter and leave events for ForwardingParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1621 + # source://prism//lib/prism/dispatcher.rb#1622 def visit_forwarding_parameter_node(node); end # Dispatch enter and leave events for ForwardingSuperNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1627 + # source://prism//lib/prism/dispatcher.rb#1628 def visit_forwarding_super_node(node); end # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1633 + # source://prism//lib/prism/dispatcher.rb#1634 def visit_global_variable_and_write_node(node); end # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1639 + # source://prism//lib/prism/dispatcher.rb#1640 def visit_global_variable_operator_write_node(node); end # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1645 + # source://prism//lib/prism/dispatcher.rb#1646 def visit_global_variable_or_write_node(node); end # Dispatch enter and leave events for GlobalVariableReadNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1651 + # source://prism//lib/prism/dispatcher.rb#1652 def visit_global_variable_read_node(node); end # Dispatch enter and leave events for GlobalVariableTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1657 + # source://prism//lib/prism/dispatcher.rb#1658 def visit_global_variable_target_node(node); end # Dispatch enter and leave events for GlobalVariableWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1663 + # source://prism//lib/prism/dispatcher.rb#1664 def visit_global_variable_write_node(node); end # Dispatch enter and leave events for HashNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1669 + # source://prism//lib/prism/dispatcher.rb#1670 def visit_hash_node(node); end # Dispatch enter and leave events for HashPatternNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1675 + # source://prism//lib/prism/dispatcher.rb#1676 def visit_hash_pattern_node(node); end # Dispatch enter and leave events for IfNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1681 + # source://prism//lib/prism/dispatcher.rb#1682 def visit_if_node(node); end # Dispatch enter and leave events for ImaginaryNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1687 + # source://prism//lib/prism/dispatcher.rb#1688 def visit_imaginary_node(node); end # Dispatch enter and leave events for ImplicitNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1693 + # source://prism//lib/prism/dispatcher.rb#1694 def visit_implicit_node(node); end # Dispatch enter and leave events for ImplicitRestNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1699 + # source://prism//lib/prism/dispatcher.rb#1700 def visit_implicit_rest_node(node); end # Dispatch enter and leave events for InNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1705 + # source://prism//lib/prism/dispatcher.rb#1706 def visit_in_node(node); end # Dispatch enter and leave events for IndexAndWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1711 + # source://prism//lib/prism/dispatcher.rb#1712 def visit_index_and_write_node(node); end # Dispatch enter and leave events for IndexOperatorWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1717 + # source://prism//lib/prism/dispatcher.rb#1718 def visit_index_operator_write_node(node); end # Dispatch enter and leave events for IndexOrWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1723 + # source://prism//lib/prism/dispatcher.rb#1724 def visit_index_or_write_node(node); end # Dispatch enter and leave events for IndexTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1729 + # source://prism//lib/prism/dispatcher.rb#1730 def visit_index_target_node(node); end # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1735 + # source://prism//lib/prism/dispatcher.rb#1736 def visit_instance_variable_and_write_node(node); end # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1741 + # source://prism//lib/prism/dispatcher.rb#1742 def visit_instance_variable_operator_write_node(node); end # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1747 + # source://prism//lib/prism/dispatcher.rb#1748 def visit_instance_variable_or_write_node(node); end # Dispatch enter and leave events for InstanceVariableReadNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1753 + # source://prism//lib/prism/dispatcher.rb#1754 def visit_instance_variable_read_node(node); end # Dispatch enter and leave events for InstanceVariableTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1759 + # source://prism//lib/prism/dispatcher.rb#1760 def visit_instance_variable_target_node(node); end # Dispatch enter and leave events for InstanceVariableWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1765 + # source://prism//lib/prism/dispatcher.rb#1766 def visit_instance_variable_write_node(node); end # Dispatch enter and leave events for IntegerNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1771 + # source://prism//lib/prism/dispatcher.rb#1772 def visit_integer_node(node); end # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1777 + # source://prism//lib/prism/dispatcher.rb#1778 def visit_interpolated_match_last_line_node(node); end # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1783 + # source://prism//lib/prism/dispatcher.rb#1784 def visit_interpolated_regular_expression_node(node); end # Dispatch enter and leave events for InterpolatedStringNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1789 + # source://prism//lib/prism/dispatcher.rb#1790 def visit_interpolated_string_node(node); end # Dispatch enter and leave events for InterpolatedSymbolNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1795 + # source://prism//lib/prism/dispatcher.rb#1796 def visit_interpolated_symbol_node(node); end # Dispatch enter and leave events for InterpolatedXStringNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1801 + # source://prism//lib/prism/dispatcher.rb#1802 def visit_interpolated_x_string_node(node); end # Dispatch enter and leave events for ItLocalVariableReadNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1807 + # source://prism//lib/prism/dispatcher.rb#1808 def visit_it_local_variable_read_node(node); end # Dispatch enter and leave events for ItParametersNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1813 + # source://prism//lib/prism/dispatcher.rb#1814 def visit_it_parameters_node(node); end # Dispatch enter and leave events for KeywordHashNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1819 + # source://prism//lib/prism/dispatcher.rb#1820 def visit_keyword_hash_node(node); end # Dispatch enter and leave events for KeywordRestParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1825 + # source://prism//lib/prism/dispatcher.rb#1826 def visit_keyword_rest_parameter_node(node); end # Dispatch enter and leave events for LambdaNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1831 + # source://prism//lib/prism/dispatcher.rb#1832 def visit_lambda_node(node); end # Dispatch enter and leave events for LocalVariableAndWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1837 + # source://prism//lib/prism/dispatcher.rb#1838 def visit_local_variable_and_write_node(node); end # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1843 + # source://prism//lib/prism/dispatcher.rb#1844 def visit_local_variable_operator_write_node(node); end # Dispatch enter and leave events for LocalVariableOrWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1849 + # source://prism//lib/prism/dispatcher.rb#1850 def visit_local_variable_or_write_node(node); end # Dispatch enter and leave events for LocalVariableReadNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1855 + # source://prism//lib/prism/dispatcher.rb#1856 def visit_local_variable_read_node(node); end # Dispatch enter and leave events for LocalVariableTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1861 + # source://prism//lib/prism/dispatcher.rb#1862 def visit_local_variable_target_node(node); end # Dispatch enter and leave events for LocalVariableWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1867 + # source://prism//lib/prism/dispatcher.rb#1868 def visit_local_variable_write_node(node); end # Dispatch enter and leave events for MatchLastLineNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1873 + # source://prism//lib/prism/dispatcher.rb#1874 def visit_match_last_line_node(node); end # Dispatch enter and leave events for MatchPredicateNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1879 + # source://prism//lib/prism/dispatcher.rb#1880 def visit_match_predicate_node(node); end # Dispatch enter and leave events for MatchRequiredNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1885 + # source://prism//lib/prism/dispatcher.rb#1886 def visit_match_required_node(node); end # Dispatch enter and leave events for MatchWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1891 + # source://prism//lib/prism/dispatcher.rb#1892 def visit_match_write_node(node); end # Dispatch enter and leave events for MissingNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1897 + # source://prism//lib/prism/dispatcher.rb#1898 def visit_missing_node(node); end # Dispatch enter and leave events for ModuleNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1903 + # source://prism//lib/prism/dispatcher.rb#1904 def visit_module_node(node); end # Dispatch enter and leave events for MultiTargetNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1909 + # source://prism//lib/prism/dispatcher.rb#1910 def visit_multi_target_node(node); end # Dispatch enter and leave events for MultiWriteNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1915 + # source://prism//lib/prism/dispatcher.rb#1916 def visit_multi_write_node(node); end # Dispatch enter and leave events for NextNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1921 + # source://prism//lib/prism/dispatcher.rb#1922 def visit_next_node(node); end # Dispatch enter and leave events for NilNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1927 + # source://prism//lib/prism/dispatcher.rb#1928 def visit_nil_node(node); end # Dispatch enter and leave events for NoKeywordsParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1933 + # source://prism//lib/prism/dispatcher.rb#1934 def visit_no_keywords_parameter_node(node); end # Dispatch enter and leave events for NumberedParametersNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1939 + # source://prism//lib/prism/dispatcher.rb#1940 def visit_numbered_parameters_node(node); end # Dispatch enter and leave events for NumberedReferenceReadNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1945 + # source://prism//lib/prism/dispatcher.rb#1946 def visit_numbered_reference_read_node(node); end # Dispatch enter and leave events for OptionalKeywordParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1951 + # source://prism//lib/prism/dispatcher.rb#1952 def visit_optional_keyword_parameter_node(node); end # Dispatch enter and leave events for OptionalParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1957 + # source://prism//lib/prism/dispatcher.rb#1958 def visit_optional_parameter_node(node); end # Dispatch enter and leave events for OrNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1963 + # source://prism//lib/prism/dispatcher.rb#1964 def visit_or_node(node); end # Dispatch enter and leave events for ParametersNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1969 + # source://prism//lib/prism/dispatcher.rb#1970 def visit_parameters_node(node); end # Dispatch enter and leave events for ParenthesesNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1975 + # source://prism//lib/prism/dispatcher.rb#1976 def visit_parentheses_node(node); end # Dispatch enter and leave events for PinnedExpressionNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1981 + # source://prism//lib/prism/dispatcher.rb#1982 def visit_pinned_expression_node(node); end # Dispatch enter and leave events for PinnedVariableNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1987 + # source://prism//lib/prism/dispatcher.rb#1988 def visit_pinned_variable_node(node); end # Dispatch enter and leave events for PostExecutionNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1993 + # source://prism//lib/prism/dispatcher.rb#1994 def visit_post_execution_node(node); end # Dispatch enter and leave events for PreExecutionNode nodes. # - # source://prism//lib/prism/dispatcher.rb#1999 + # source://prism//lib/prism/dispatcher.rb#2000 def visit_pre_execution_node(node); end # Dispatch enter and leave events for ProgramNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2005 + # source://prism//lib/prism/dispatcher.rb#2006 def visit_program_node(node); end # Dispatch enter and leave events for RangeNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2011 + # source://prism//lib/prism/dispatcher.rb#2012 def visit_range_node(node); end # Dispatch enter and leave events for RationalNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2017 + # source://prism//lib/prism/dispatcher.rb#2018 def visit_rational_node(node); end # Dispatch enter and leave events for RedoNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2023 + # source://prism//lib/prism/dispatcher.rb#2024 def visit_redo_node(node); end # Dispatch enter and leave events for RegularExpressionNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2029 + # source://prism//lib/prism/dispatcher.rb#2030 def visit_regular_expression_node(node); end # Dispatch enter and leave events for RequiredKeywordParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2035 + # source://prism//lib/prism/dispatcher.rb#2036 def visit_required_keyword_parameter_node(node); end # Dispatch enter and leave events for RequiredParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2041 + # source://prism//lib/prism/dispatcher.rb#2042 def visit_required_parameter_node(node); end # Dispatch enter and leave events for RescueModifierNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2047 + # source://prism//lib/prism/dispatcher.rb#2048 def visit_rescue_modifier_node(node); end # Dispatch enter and leave events for RescueNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2053 + # source://prism//lib/prism/dispatcher.rb#2054 def visit_rescue_node(node); end # Dispatch enter and leave events for RestParameterNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2059 + # source://prism//lib/prism/dispatcher.rb#2060 def visit_rest_parameter_node(node); end # Dispatch enter and leave events for RetryNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2065 + # source://prism//lib/prism/dispatcher.rb#2066 def visit_retry_node(node); end # Dispatch enter and leave events for ReturnNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2071 + # source://prism//lib/prism/dispatcher.rb#2072 def visit_return_node(node); end # Dispatch enter and leave events for SelfNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2077 + # source://prism//lib/prism/dispatcher.rb#2078 def visit_self_node(node); end # Dispatch enter and leave events for ShareableConstantNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2083 + # source://prism//lib/prism/dispatcher.rb#2084 def visit_shareable_constant_node(node); end # Dispatch enter and leave events for SingletonClassNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2089 + # source://prism//lib/prism/dispatcher.rb#2090 def visit_singleton_class_node(node); end # Dispatch enter and leave events for SourceEncodingNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2095 + # source://prism//lib/prism/dispatcher.rb#2096 def visit_source_encoding_node(node); end # Dispatch enter and leave events for SourceFileNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2101 + # source://prism//lib/prism/dispatcher.rb#2102 def visit_source_file_node(node); end # Dispatch enter and leave events for SourceLineNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2107 + # source://prism//lib/prism/dispatcher.rb#2108 def visit_source_line_node(node); end # Dispatch enter and leave events for SplatNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2113 + # source://prism//lib/prism/dispatcher.rb#2114 def visit_splat_node(node); end # Dispatch enter and leave events for StatementsNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2119 + # source://prism//lib/prism/dispatcher.rb#2120 def visit_statements_node(node); end # Dispatch enter and leave events for StringNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2125 + # source://prism//lib/prism/dispatcher.rb#2126 def visit_string_node(node); end # Dispatch enter and leave events for SuperNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2131 + # source://prism//lib/prism/dispatcher.rb#2132 def visit_super_node(node); end # Dispatch enter and leave events for SymbolNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2137 + # source://prism//lib/prism/dispatcher.rb#2138 def visit_symbol_node(node); end # Dispatch enter and leave events for TrueNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2143 + # source://prism//lib/prism/dispatcher.rb#2144 def visit_true_node(node); end # Dispatch enter and leave events for UndefNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2149 + # source://prism//lib/prism/dispatcher.rb#2150 def visit_undef_node(node); end # Dispatch enter and leave events for UnlessNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2155 + # source://prism//lib/prism/dispatcher.rb#2156 def visit_unless_node(node); end # Dispatch enter and leave events for UntilNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2161 + # source://prism//lib/prism/dispatcher.rb#2162 def visit_until_node(node); end # Dispatch enter and leave events for WhenNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2167 + # source://prism//lib/prism/dispatcher.rb#2168 def visit_when_node(node); end # Dispatch enter and leave events for WhileNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2173 + # source://prism//lib/prism/dispatcher.rb#2174 def visit_while_node(node); end # Dispatch enter and leave events for XStringNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2179 + # source://prism//lib/prism/dispatcher.rb#2180 def visit_x_string_node(node); end # Dispatch enter and leave events for YieldNode nodes. # - # source://prism//lib/prism/dispatcher.rb#2185 + # source://prism//lib/prism/dispatcher.rb#2186 def visit_yield_node(node); end end @@ -12398,97 +12365,97 @@ class Prism::DotVisitor < ::Prism::Visitor # Visit a SelfNode node. # - # source://prism//lib/prism/dot_visitor.rb#4047 + # source://prism//lib/prism/dot_visitor.rb#4044 def visit_self_node(node); end # Visit a ShareableConstantNode node. # - # source://prism//lib/prism/dot_visitor.rb#4061 + # source://prism//lib/prism/dot_visitor.rb#4058 def visit_shareable_constant_node(node); end # Visit a SingletonClassNode node. # - # source://prism//lib/prism/dot_visitor.rb#4082 + # source://prism//lib/prism/dot_visitor.rb#4079 def visit_singleton_class_node(node); end # Visit a SourceEncodingNode node. # - # source://prism//lib/prism/dot_visitor.rb#4118 + # source://prism//lib/prism/dot_visitor.rb#4115 def visit_source_encoding_node(node); end # Visit a SourceFileNode node. # - # source://prism//lib/prism/dot_visitor.rb#4132 + # source://prism//lib/prism/dot_visitor.rb#4129 def visit_source_file_node(node); end # Visit a SourceLineNode node. # - # source://prism//lib/prism/dot_visitor.rb#4152 + # source://prism//lib/prism/dot_visitor.rb#4149 def visit_source_line_node(node); end # Visit a SplatNode node. # - # source://prism//lib/prism/dot_visitor.rb#4166 + # source://prism//lib/prism/dot_visitor.rb#4163 def visit_splat_node(node); end # Visit a StatementsNode node. # - # source://prism//lib/prism/dot_visitor.rb#4189 + # source://prism//lib/prism/dot_visitor.rb#4186 def visit_statements_node(node); end # Visit a StringNode node. # - # source://prism//lib/prism/dot_visitor.rb#4216 + # source://prism//lib/prism/dot_visitor.rb#4213 def visit_string_node(node); end # Visit a SuperNode node. # - # source://prism//lib/prism/dot_visitor.rb#4249 + # source://prism//lib/prism/dot_visitor.rb#4246 def visit_super_node(node); end # Visit a SymbolNode node. # - # source://prism//lib/prism/dot_visitor.rb#4288 + # source://prism//lib/prism/dot_visitor.rb#4285 def visit_symbol_node(node); end # Visit a TrueNode node. # - # source://prism//lib/prism/dot_visitor.rb#4323 + # source://prism//lib/prism/dot_visitor.rb#4320 def visit_true_node(node); end # Visit a UndefNode node. # - # source://prism//lib/prism/dot_visitor.rb#4337 + # source://prism//lib/prism/dot_visitor.rb#4334 def visit_undef_node(node); end # Visit a UnlessNode node. # - # source://prism//lib/prism/dot_visitor.rb#4367 + # source://prism//lib/prism/dot_visitor.rb#4364 def visit_unless_node(node); end # Visit a UntilNode node. # - # source://prism//lib/prism/dot_visitor.rb#4410 + # source://prism//lib/prism/dot_visitor.rb#4407 def visit_until_node(node); end # Visit a WhenNode node. # - # source://prism//lib/prism/dot_visitor.rb#4445 + # source://prism//lib/prism/dot_visitor.rb#4442 def visit_when_node(node); end # Visit a WhileNode node. # - # source://prism//lib/prism/dot_visitor.rb#4486 + # source://prism//lib/prism/dot_visitor.rb#4483 def visit_while_node(node); end # Visit a XStringNode node. # - # source://prism//lib/prism/dot_visitor.rb#4521 + # source://prism//lib/prism/dot_visitor.rb#4518 def visit_x_string_node(node); end # Visit a YieldNode node. # - # source://prism//lib/prism/dot_visitor.rb#4550 + # source://prism//lib/prism/dot_visitor.rb#4547 def visit_yield_node(node); end private @@ -12496,101 +12463,95 @@ class Prism::DotVisitor < ::Prism::Visitor # Inspect a node that has arguments_node_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4596 + # source://prism//lib/prism/dot_visitor.rb#4593 def arguments_node_flags_inspect(node); end # Inspect a node that has array_node_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4605 + # source://prism//lib/prism/dot_visitor.rb#4603 def array_node_flags_inspect(node); end # Inspect a node that has call_node_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4613 + # source://prism//lib/prism/dot_visitor.rb#4611 def call_node_flags_inspect(node); end # Inspect a node that has encoding_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4624 + # source://prism//lib/prism/dot_visitor.rb#4622 def encoding_flags_inspect(node); end # Inspect a node that has integer_base_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4633 + # source://prism//lib/prism/dot_visitor.rb#4631 def integer_base_flags_inspect(node); end # Inspect a node that has interpolated_string_node_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4644 + # source://prism//lib/prism/dot_visitor.rb#4642 def interpolated_string_node_flags_inspect(node); end # Inspect a node that has keyword_hash_node_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4653 + # source://prism//lib/prism/dot_visitor.rb#4651 def keyword_hash_node_flags_inspect(node); end # Inspect a location to display the start and end line and column numbers. # - # source://prism//lib/prism/dot_visitor.rb#4590 + # source://prism//lib/prism/dot_visitor.rb#4587 def location_inspect(location); end # Inspect a node that has loop_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4661 + # source://prism//lib/prism/dot_visitor.rb#4659 def loop_flags_inspect(node); end # Generate a unique node ID for a node throughout the digraph. # - # source://prism//lib/prism/dot_visitor.rb#4585 + # source://prism//lib/prism/dot_visitor.rb#4582 def node_id(node); end # Inspect a node that has parameter_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4669 + # source://prism//lib/prism/dot_visitor.rb#4667 def parameter_flags_inspect(node); end # Inspect a node that has range_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4677 + # source://prism//lib/prism/dot_visitor.rb#4675 def range_flags_inspect(node); end # Inspect a node that has regular_expression_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4685 + # source://prism//lib/prism/dot_visitor.rb#4683 def regular_expression_flags_inspect(node); end - # Inspect a node that has return_node_flags flags to display the flags as a - # comma-separated list. - # - # source://prism//lib/prism/dot_visitor.rb#4703 - def return_node_flags_inspect(node); end - # Inspect a node that has shareable_constant_node_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4711 + # source://prism//lib/prism/dot_visitor.rb#4701 def shareable_constant_node_flags_inspect(node); end # Inspect a node that has string_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4721 + # source://prism//lib/prism/dot_visitor.rb#4711 def string_flags_inspect(node); end # Inspect a node that has symbol_flags flags to display the flags as a # comma-separated list. # - # source://prism//lib/prism/dot_visitor.rb#4732 + # source://prism//lib/prism/dot_visitor.rb#4722 def symbol_flags_inspect(node); end end @@ -12684,102 +12645,75 @@ end # if a then b else c end # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#6173 +# source://prism//lib/prism/node.rb#5448 class Prism::ElseNode < ::Prism::Node - # def initialize: (Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc, Location location) -> void + # Initialize a new ElseNode node. # # @return [ElseNode] a new instance of ElseNode # - # source://prism//lib/prism/node.rb#6175 - 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 + # source://prism//lib/prism/node.rb#5450 + def initialize(source, node_id, location, flags, else_keyword_loc, statements, end_keyword_loc); 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#6286 + # source://prism//lib/prism/node.rb#5545 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6184 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#5461 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6189 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5466 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6201 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5478 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6194 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5471 def compact_child_nodes; end - # def copy: (?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?, ?location: Location) -> ElseNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode # - # source://prism//lib/prism/node.rb#6206 - 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 + # source://prism//lib/prism/node.rb#5483 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6189 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5466 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location? } # - # source://prism//lib/prism/node.rb#6214 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5491 def deconstruct_keys(keys); end # def else_keyword: () -> String # - # source://prism//lib/prism/node.rb#6242 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5519 def else_keyword; end # attr_reader else_keyword_loc: Location # - # source://prism//lib/prism/node.rb#6219 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5496 def else_keyword_loc; end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#6247 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#5524 def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#6229 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5506 def end_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -12787,44 +12721,25 @@ class Prism::ElseNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#6252 + # source://prism//lib/prism/node.rb#5529 sig { override.returns(String) } def inspect; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#6226 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#5503 def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#6270 + # source://prism//lib/prism/node.rb#5534 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#6280 + # source://prism//lib/prism/node.rb#5539 def type; end end end @@ -12832,11 +12747,11 @@ end # EmbDocComment objects correspond to comments that are surrounded by =begin # and =end. # -# source://prism//lib/prism/parse_result.rb#403 +# source://prism//lib/prism/parse_result.rb#412 class Prism::EmbDocComment < ::Prism::Comment # Returns a string representation of this comment. # - # source://prism//lib/prism/parse_result.rb#410 + # source://prism//lib/prism/parse_result.rb#419 sig { returns(String) } def inspect; end @@ -12844,7 +12759,7 @@ class Prism::EmbDocComment < ::Prism::Comment # # @return [Boolean] # - # source://prism//lib/prism/parse_result.rb#405 + # source://prism//lib/prism/parse_result.rb#414 sig { override.returns(T::Boolean) } def trailing?; end end @@ -12854,90 +12769,65 @@ end # "foo #{bar}" # ^^^^^^ # -# source://prism//lib/prism/node.rb#6298 +# source://prism//lib/prism/node.rb#5557 class Prism::EmbeddedStatementsNode < ::Prism::Node - # def initialize: (Location opening_loc, StatementsNode? statements, Location closing_loc, Location location) -> void + # Initialize a new EmbeddedStatementsNode node. # # @return [EmbeddedStatementsNode] a new instance of EmbeddedStatementsNode # - # source://prism//lib/prism/node.rb#6300 - 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 + # source://prism//lib/prism/node.rb#5559 + def initialize(source, node_id, location, flags, opening_loc, statements, closing_loc); 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#6405 + # source://prism//lib/prism/node.rb#5648 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6309 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#5570 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6314 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5575 def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#6366 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5627 def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#6354 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5615 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6326 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5587 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6319 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5580 def compact_child_nodes; end - # def copy: (?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location, ?location: Location) -> EmbeddedStatementsNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode # - # source://prism//lib/prism/node.rb#6331 - 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 + # source://prism//lib/prism/node.rb#5592 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6314 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5575 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, statements: StatementsNode?, closing_loc: Location } # - # source://prism//lib/prism/node.rb#6339 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5600 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -12945,56 +12835,35 @@ class Prism::EmbeddedStatementsNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#6371 + # source://prism//lib/prism/node.rb#5632 sig { override.returns(String) } def inspect; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#6361 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5622 def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#6344 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5605 def opening_loc; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#6351 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#5612 def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#6389 + # source://prism//lib/prism/node.rb#5637 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#6399 + # source://prism//lib/prism/node.rb#5642 def type; end end end @@ -13004,76 +12873,55 @@ end # "foo #@bar" # ^^^^^ # -# source://prism//lib/prism/node.rb#6417 +# source://prism//lib/prism/node.rb#5660 class Prism::EmbeddedVariableNode < ::Prism::Node - # def initialize: (Location operator_loc, Prism::node variable, Location location) -> void + # Initialize a new EmbeddedVariableNode node. # # @return [EmbeddedVariableNode] a new instance of EmbeddedVariableNode # - # source://prism//lib/prism/node.rb#6419 - 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 + # source://prism//lib/prism/node.rb#5662 + def initialize(source, node_id, location, flags, operator_loc, variable); 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#6509 + # source://prism//lib/prism/node.rb#5736 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6427 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#5672 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6432 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5677 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6442 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5687 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6437 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5682 def compact_child_nodes; end - # def copy: (?operator_loc: Location, ?variable: Prism::node, ?location: Location) -> EmbeddedVariableNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: Prism::node) -> EmbeddedVariableNode # - # source://prism//lib/prism/node.rb#6447 - 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 + # source://prism//lib/prism/node.rb#5692 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), variable: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6432 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5677 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, variable: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, variable: Prism::node } # - # source://prism//lib/prism/node.rb#6455 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5700 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -13081,73 +12929,52 @@ class Prism::EmbeddedVariableNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#6475 + # source://prism//lib/prism/node.rb#5720 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#6470 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5715 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#6460 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5705 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#6493 + # source://prism//lib/prism/node.rb#5725 sig { override.returns(Symbol) } def type; end # attr_reader variable: Prism::node # - # source://prism//lib/prism/node.rb#6467 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#5712 def variable; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#6503 + # source://prism//lib/prism/node.rb#5730 def type; end end end # Flags for nodes that have unescaped content. # -# source://prism//lib/prism/node.rb#19157 +# source://prism//lib/prism/node.rb#16680 module Prism::EncodingFlags; end # internal bytes forced the encoding to binary # -# source://prism//lib/prism/node.rb#19162 +# source://prism//lib/prism/node.rb#16685 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#19159 +# source://prism//lib/prism/node.rb#16682 Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # Represents an `ensure` clause in a `begin` statement. @@ -13159,102 +12986,75 @@ Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # bar # end # -# source://prism//lib/prism/node.rb#6524 +# source://prism//lib/prism/node.rb#5751 class Prism::EnsureNode < ::Prism::Node - # def initialize: (Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc, Location location) -> void + # Initialize a new EnsureNode node. # # @return [EnsureNode] a new instance of EnsureNode # - # source://prism//lib/prism/node.rb#6526 - 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 + # source://prism//lib/prism/node.rb#5753 + def initialize(source, node_id, location, flags, ensure_keyword_loc, statements, end_keyword_loc); 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#6631 + # source://prism//lib/prism/node.rb#5842 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6535 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#5764 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6540 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5769 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6552 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5781 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6545 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5774 def compact_child_nodes; end - # def copy: (?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location, ?location: Location) -> EnsureNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode # - # source://prism//lib/prism/node.rb#6557 - 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 + # source://prism//lib/prism/node.rb#5786 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6540 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5769 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location } # - # source://prism//lib/prism/node.rb#6565 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5794 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#6592 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5821 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#6580 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5809 def end_keyword_loc; end # def ensure_keyword: () -> String # - # source://prism//lib/prism/node.rb#6587 - sig { returns(String) } + # source://prism//lib/prism/node.rb#5816 def ensure_keyword; end # attr_reader ensure_keyword_loc: Location # - # source://prism//lib/prism/node.rb#6570 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#5799 def ensure_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -13262,44 +13062,25 @@ class Prism::EnsureNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#6597 + # source://prism//lib/prism/node.rb#5826 sig { override.returns(String) } def inspect; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#6577 - sig { returns(T.nilable(Prism::StatementsNode)) } - def statements; end - - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # source://prism//lib/prism/node.rb#5806 + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#6615 + # source://prism//lib/prism/node.rb#5831 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#6625 + # source://prism//lib/prism/node.rb#5836 def type; end end end @@ -13309,63 +13090,55 @@ end # false # ^^^^^ # -# source://prism//lib/prism/node.rb#6643 +# source://prism//lib/prism/node.rb#5854 class Prism::FalseNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new FalseNode node. # # @return [FalseNode] a new instance of FalseNode # - # source://prism//lib/prism/node.rb#6645 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#5856 + def initialize(source, node_id, location, flags); 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#6718 + # source://prism//lib/prism/node.rb#5913 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6651 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#5864 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6656 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5869 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6666 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5879 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6661 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5874 def compact_child_nodes; end - # def copy: (?location: Location) -> FalseNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> FalseNode # - # source://prism//lib/prism/node.rb#6671 - sig { params(location: Prism::Location).returns(Prism::FalseNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#5884 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6656 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5869 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#6679 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5892 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -13373,38 +13146,20 @@ class Prism::FalseNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#6684 + # source://prism//lib/prism/node.rb#5897 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#6702 + # source://prism//lib/prism/node.rb#5902 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#6712 + # source://prism//lib/prism/node.rb#5907 def type; end end end @@ -13420,102 +13175,70 @@ end # foo in Foo(*bar, baz, *qux) # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#6733 +# source://prism//lib/prism/node.rb#5928 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 + # Initialize a new FindPatternNode node. # # @return [FindPatternNode] a new instance of FindPatternNode # - # source://prism//lib/prism/node.rb#6735 - 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 + # source://prism//lib/prism/node.rb#5930 + def initialize(source, node_id, location, flags, constant, left, requireds, right, opening_loc, closing_loc); 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#6867 + # source://prism//lib/prism/node.rb#6046 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6747 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#5944 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6752 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5949 def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#6828 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#6025 def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#6810 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#6007 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6767 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#5964 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6757 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5954 def compact_child_nodes; end # attr_reader constant: Prism::node? # - # source://prism//lib/prism/node.rb#6785 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#5982 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: Prism::node?, ?left: Prism::node, ?requireds: Array[Prism::node], ?right: Prism::node, ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode # - # source://prism//lib/prism/node.rb#6772 - 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 + # source://prism//lib/prism/node.rb#5969 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), left: T.unsafe(nil), requireds: T.unsafe(nil), right: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6752 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#5949 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: Prism::node?, left: Prism::node, requireds: Array[Prism::node], right: Prism::node, opening_loc: Location?, closing_loc: Location? } # - # source://prism//lib/prism/node.rb#6780 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#5977 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -13523,68 +13246,45 @@ class Prism::FindPatternNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#6833 + # source://prism//lib/prism/node.rb#6030 sig { override.returns(String) } def inspect; end # attr_reader left: Prism::node # - # source://prism//lib/prism/node.rb#6788 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#5985 def left; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#6823 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#6020 def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#6797 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#5994 def opening_loc; end # attr_reader requireds: Array[Prism::node] # - # source://prism//lib/prism/node.rb#6791 - sig { returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#5988 def requireds; end # attr_reader right: Prism::node # - # source://prism//lib/prism/node.rb#6794 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#5991 def right; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#6851 + # source://prism//lib/prism/node.rb#6035 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#6861 + # source://prism//lib/prism/node.rb#6040 def type; end end end @@ -13594,79 +13294,81 @@ end # baz if foo .. bar # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#6883 +# source://prism//lib/prism/node.rb#6062 class Prism::FlipFlopNode < ::Prism::Node - # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void + # Initialize a new FlipFlopNode node. # # @return [FlipFlopNode] a new instance of FlipFlopNode # - # source://prism//lib/prism/node.rb#6885 + # source://prism//lib/prism/node.rb#6064 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, left: T.nilable(Prism::Node), right: T.nilable(Prism::Node), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: Prism::Location ).void end - def initialize(source, flags, left, right, operator_loc, location); end + def initialize(source, node_id, location, flags, left, right, operator_loc); 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#6992 + # source://prism//lib/prism/node.rb#6150 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6895 + # source://prism//lib/prism/node.rb#6075 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#6900 + # source://prism//lib/prism/node.rb#6080 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#6913 + # source://prism//lib/prism/node.rb#6093 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#6905 + # source://prism//lib/prism/node.rb#6085 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode # - # source://prism//lib/prism/node.rb#6918 + # source://prism//lib/prism/node.rb#6098 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, left: T.nilable(Prism::Node), right: T.nilable(Prism::Node), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6900 + # source://prism//lib/prism/node.rb#6080 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node?, right: Prism::node?, operator_loc: Location } # - # source://prism//lib/prism/node.rb#6926 + # source://prism//lib/prism/node.rb#6106 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -13674,7 +13376,7 @@ class Prism::FlipFlopNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#6948 + # source://prism//lib/prism/node.rb#6111 sig { returns(T::Boolean) } def exclude_end?; end @@ -13683,70 +13385,44 @@ class Prism::FlipFlopNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#6958 + # source://prism//lib/prism/node.rb#6134 sig { override.returns(String) } def inspect; end # attr_reader left: Prism::node? # - # source://prism//lib/prism/node.rb#6935 + # source://prism//lib/prism/node.rb#6116 sig { returns(T.nilable(Prism::Node)) } def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#6953 + # source://prism//lib/prism/node.rb#6129 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#6941 + # source://prism//lib/prism/node.rb#6122 sig { returns(Prism::Location) } def operator_loc; end # attr_reader right: Prism::node? # - # source://prism//lib/prism/node.rb#6938 + # source://prism//lib/prism/node.rb#6119 sig { returns(T.nilable(Prism::Node)) } def right; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#6976 + # source://prism//lib/prism/node.rb#6139 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#6931 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#6986 + # source://prism//lib/prism/node.rb#6144 def type; end end end @@ -13756,63 +13432,55 @@ end # 1.0 # ^^^ # -# source://prism//lib/prism/node.rb#7005 +# source://prism//lib/prism/node.rb#6163 class Prism::FloatNode < ::Prism::Node - # def initialize: (Float value, Location location) -> void + # Initialize a new FloatNode node. # # @return [FloatNode] a new instance of FloatNode # - # source://prism//lib/prism/node.rb#7007 - sig { params(source: Prism::Source, value: Float, location: Prism::Location).void } - def initialize(source, value, location); end + # source://prism//lib/prism/node.rb#6165 + def initialize(source, node_id, location, flags, value); 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#7084 + # source://prism//lib/prism/node.rb#6226 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7014 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6174 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7019 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6179 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7029 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6189 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7024 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6184 def compact_child_nodes; end - # def copy: (?value: Float, ?location: Location) -> FloatNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode # - # source://prism//lib/prism/node.rb#7034 - sig { params(value: Float, location: Prism::Location).returns(Prism::FloatNode) } - def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#6194 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7019 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6179 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Float, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Float } # - # source://prism//lib/prism/node.rb#7042 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#6202 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -13820,44 +13488,25 @@ class Prism::FloatNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#7050 + # source://prism//lib/prism/node.rb#6210 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#7068 + # source://prism//lib/prism/node.rb#6215 sig { override.returns(Symbol) } def type; end # The value of the floating point number as a Float. # - # source://prism//lib/prism/node.rb#7047 - sig { returns(Float) } + # source://prism//lib/prism/node.rb#6207 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7078 + # source://prism//lib/prism/node.rb#6220 def type; end end end @@ -13867,44 +13516,29 @@ end # for i in a end # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#7094 +# source://prism//lib/prism/node.rb#6236 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 + # Initialize a new ForNode node. # # @return [ForNode] a new instance of ForNode # - # source://prism//lib/prism/node.rb#7096 - 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 + # source://prism//lib/prism/node.rb#6238 + def initialize(source, node_id, location, flags, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc); 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#7266 + # source://prism//lib/prism/node.rb#6392 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7109 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6253 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7114 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6258 def child_nodes; end # The collection to iterate over. @@ -13912,56 +13546,38 @@ class Prism::ForNode < ::Prism::Node # for i in a end # ^ # - # source://prism//lib/prism/node.rb#7155 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#6299 def collection; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7128 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6272 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7119 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6263 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?index: Prism::node, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode # - # source://prism//lib/prism/node.rb#7133 - 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 + # source://prism//lib/prism/node.rb#6277 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), index: T.unsafe(nil), collection: T.unsafe(nil), statements: T.unsafe(nil), for_keyword_loc: T.unsafe(nil), in_keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7114 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6258 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, index: Prism::node, collection: Prism::node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location } # - # source://prism//lib/prism/node.rb#7141 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#6285 def deconstruct_keys(keys); end # def do_keyword: () -> String? # - # source://prism//lib/prism/node.rb#7222 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#6366 def do_keyword; end # The location of the `do` keyword, if present. @@ -13969,14 +13585,12 @@ class Prism::ForNode < ::Prism::Node # for i in a do end # ^^ # - # source://prism//lib/prism/node.rb#7189 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#6333 def do_keyword_loc; end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#7227 - sig { returns(String) } + # source://prism//lib/prism/node.rb#6371 def end_keyword; end # The location of the `end` keyword. @@ -13984,8 +13598,7 @@ class Prism::ForNode < ::Prism::Node # for i in a end # ^^^ # - # source://prism//lib/prism/node.rb#7205 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6349 def end_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -13993,8 +13606,7 @@ class Prism::ForNode < ::Prism::Node # def for_keyword: () -> String # - # source://prism//lib/prism/node.rb#7212 - sig { returns(String) } + # source://prism//lib/prism/node.rb#6356 def for_keyword; end # The location of the `for` keyword. @@ -14002,14 +13614,12 @@ class Prism::ForNode < ::Prism::Node # for i in a end # ^^^ # - # source://prism//lib/prism/node.rb#7169 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6313 def for_keyword_loc; end # def in_keyword: () -> String # - # source://prism//lib/prism/node.rb#7217 - sig { returns(String) } + # source://prism//lib/prism/node.rb#6361 def in_keyword; end # The location of the `in` keyword. @@ -14017,8 +13627,7 @@ class Prism::ForNode < ::Prism::Node # for i in a end # ^^ # - # source://prism//lib/prism/node.rb#7179 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6323 def in_keyword_loc; end # The index expression for `for` loops. @@ -14026,13 +13635,12 @@ class Prism::ForNode < ::Prism::Node # for i in a end # ^ # - # source://prism//lib/prism/node.rb#7149 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#6293 def index; end # def inspect -> String # - # source://prism//lib/prism/node.rb#7232 + # source://prism//lib/prism/node.rb#6376 sig { override.returns(String) } def inspect; end @@ -14043,38 +13651,19 @@ class Prism::ForNode < ::Prism::Node # ^^^^^^ # end # - # source://prism//lib/prism/node.rb#7163 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#6307 def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7250 + # source://prism//lib/prism/node.rb#6381 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#7260 + # source://prism//lib/prism/node.rb#6386 def type; end end end @@ -14086,102 +13675,76 @@ end # ^^^ # end # -# source://prism//lib/prism/node.rb#7284 +# source://prism//lib/prism/node.rb#6410 class Prism::ForwardingArgumentsNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new ForwardingArgumentsNode node. # # @return [ForwardingArgumentsNode] a new instance of ForwardingArgumentsNode # - # source://prism//lib/prism/node.rb#7286 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#6412 + def initialize(source, node_id, location, flags); 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#7359 + # source://prism//lib/prism/node.rb#6469 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7292 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6420 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7297 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6425 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7307 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6435 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7302 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6430 def compact_child_nodes; end - # def copy: (?location: Location) -> ForwardingArgumentsNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingArgumentsNode # - # source://prism//lib/prism/node.rb#7312 - sig { params(location: Prism::Location).returns(Prism::ForwardingArgumentsNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#6440 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7297 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6425 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } - # - # source://prism//lib/prism/node.rb#7320 - 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 -> String - # - # source://prism//lib/prism/node.rb#7325 - sig { override.returns(String) } - def inspect; end - - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/node.rb#6448 + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # def type: () -> Symbol + # source://prism//lib/prism/node.rb#6453 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#7343 + # source://prism//lib/prism/node.rb#6458 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7353 + # source://prism//lib/prism/node.rb#6463 def type; end end end @@ -14192,63 +13755,55 @@ end # ^^^ # end # -# source://prism//lib/prism/node.rb#7369 +# source://prism//lib/prism/node.rb#6479 class Prism::ForwardingParameterNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new ForwardingParameterNode node. # # @return [ForwardingParameterNode] a new instance of ForwardingParameterNode # - # source://prism//lib/prism/node.rb#7371 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#6481 + def initialize(source, node_id, location, flags); 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#7444 + # source://prism//lib/prism/node.rb#6538 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7377 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6489 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7382 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6494 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7392 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6504 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7387 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6499 def compact_child_nodes; end - # def copy: (?location: Location) -> ForwardingParameterNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode # - # source://prism//lib/prism/node.rb#7397 - sig { params(location: Prism::Location).returns(Prism::ForwardingParameterNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#6509 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7382 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6494 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#7405 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#6517 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -14256,38 +13811,20 @@ class Prism::ForwardingParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#7410 + # source://prism//lib/prism/node.rb#6522 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7428 + # source://prism//lib/prism/node.rb#6527 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#7438 + # source://prism//lib/prism/node.rb#6532 def type; end end end @@ -14297,69 +13834,60 @@ end # super # ^^^^^ # -# source://prism//lib/prism/node.rb#7453 +# source://prism//lib/prism/node.rb#6547 class Prism::ForwardingSuperNode < ::Prism::Node - # def initialize: (BlockNode? block, Location location) -> void + # Initialize a new ForwardingSuperNode node. # # @return [ForwardingSuperNode] a new instance of ForwardingSuperNode # - # source://prism//lib/prism/node.rb#7455 - sig { params(source: Prism::Source, block: T.nilable(Prism::BlockNode), location: Prism::Location).void } - def initialize(source, block, location); end + # source://prism//lib/prism/node.rb#6549 + def initialize(source, node_id, location, flags, block); 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#7534 + # source://prism//lib/prism/node.rb#6612 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7462 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6558 def accept(visitor); end # attr_reader block: BlockNode? # - # source://prism//lib/prism/node.rb#7497 - sig { returns(T.nilable(Prism::BlockNode)) } + # source://prism//lib/prism/node.rb#6593 def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7467 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6563 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7479 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6575 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7472 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6568 def compact_child_nodes; end - # def copy: (?block: BlockNode?, ?location: Location) -> ForwardingSuperNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode # - # source://prism//lib/prism/node.rb#7484 - sig { params(block: T.nilable(Prism::BlockNode), location: Prism::Location).returns(Prism::ForwardingSuperNode) } - def copy(block: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#6580 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), block: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7467 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6563 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { block: BlockNode?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, block: BlockNode? } # - # source://prism//lib/prism/node.rb#7492 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#6588 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -14367,38 +13895,20 @@ class Prism::ForwardingSuperNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#7500 + # source://prism//lib/prism/node.rb#6596 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7518 + # source://prism//lib/prism/node.rb#6601 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#7528 + # source://prism//lib/prism/node.rb#6606 def type; end end end @@ -14408,83 +13918,58 @@ end # $target &&= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#7544 +# source://prism//lib/prism/node.rb#6622 class Prism::GlobalVariableAndWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new GlobalVariableAndWriteNode node. # # @return [GlobalVariableAndWriteNode] a new instance of GlobalVariableAndWriteNode # - # source://prism//lib/prism/node.rb#7546 - 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 + # source://prism//lib/prism/node.rb#6624 + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#7648 + # source://prism//lib/prism/node.rb#6710 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7556 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6636 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7561 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6641 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7571 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6651 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7566 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6646 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableAndWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode # - # source://prism//lib/prism/node.rb#7576 - 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 + # source://prism//lib/prism/node.rb#6656 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7561 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6641 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#7584 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#6664 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#163 + # source://prism//lib/prism/desugar_compiler.rb#200 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -14492,68 +13977,45 @@ class Prism::GlobalVariableAndWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#7614 + # source://prism//lib/prism/node.rb#6694 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#7589 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#6669 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#7592 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6672 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#7609 - sig { returns(String) } + # source://prism//lib/prism/node.rb#6689 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#7599 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6679 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7632 + # source://prism//lib/prism/node.rb#6699 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#7606 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#6686 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7642 + # source://prism//lib/prism/node.rb#6704 def type; end end end @@ -14563,97 +14025,68 @@ end # $target += value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#7661 +# source://prism//lib/prism/node.rb#6723 class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # Initialize a new GlobalVariableOperatorWriteNode node. # # @return [GlobalVariableOperatorWriteNode] a new instance of GlobalVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#7663 - sig do - params( - source: Prism::Source, - name: Symbol, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).void - end - def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end + # source://prism//lib/prism/node.rb#6725 + def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); 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#7764 + # source://prism//lib/prism/node.rb#6810 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7674 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6738 def accept(visitor); end # attr_reader binary_operator: Symbol # - # source://prism//lib/prism/node.rb#7727 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#6791 def binary_operator; end # attr_reader binary_operator_loc: Location # - # source://prism//lib/prism/node.rb#7717 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6781 def binary_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7679 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6743 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7689 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6753 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7684 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6748 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#7694 - sig do - params( - name: Symbol, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).returns(Prism::GlobalVariableOperatorWriteNode) - end - def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#6758 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7679 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6743 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } # - # source://prism//lib/prism/node.rb#7702 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#6766 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#175 + # source://prism//lib/prism/desugar_compiler.rb#212 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -14661,68 +14094,47 @@ class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#7730 + # source://prism//lib/prism/node.rb#6794 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#7707 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#6771 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#7710 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6774 def name_loc; end # Returns the binary operator used to modify the receiver. This method is # deprecated in favor of #binary_operator. # - # source://prism//lib/prism/node_ext.rb#387 + # source://prism//lib/prism/node_ext.rb#403 def operator; end # Returns the location of the binary operator used to modify the receiver. # This method is deprecated in favor of #binary_operator_loc. # - # source://prism//lib/prism/node_ext.rb#394 + # source://prism//lib/prism/node_ext.rb#410 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7748 + # source://prism//lib/prism/node.rb#6799 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#7724 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#6788 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#7758 + # source://prism//lib/prism/node.rb#6804 def type; end end end @@ -14732,83 +14144,58 @@ end # $target ||= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#7778 +# source://prism//lib/prism/node.rb#6824 class Prism::GlobalVariableOrWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new GlobalVariableOrWriteNode node. # # @return [GlobalVariableOrWriteNode] a new instance of GlobalVariableOrWriteNode # - # source://prism//lib/prism/node.rb#7780 - 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 + # source://prism//lib/prism/node.rb#6826 + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#7882 + # source://prism//lib/prism/node.rb#6912 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7790 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6838 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7795 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6843 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7805 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6853 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7800 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6848 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableOrWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode # - # source://prism//lib/prism/node.rb#7810 - 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 + # source://prism//lib/prism/node.rb#6858 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7795 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6843 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#7818 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#6866 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#169 + # source://prism//lib/prism/desugar_compiler.rb#206 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -14816,68 +14203,45 @@ class Prism::GlobalVariableOrWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#7848 + # source://prism//lib/prism/node.rb#6896 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#7823 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#6871 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#7826 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6874 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#7843 - sig { returns(String) } + # source://prism//lib/prism/node.rb#6891 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#7833 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#6881 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#7866 + # source://prism//lib/prism/node.rb#6901 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#7840 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#6888 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7876 + # source://prism//lib/prism/node.rb#6906 def type; end end end @@ -14887,63 +14251,55 @@ end # $foo # ^^^^ # -# source://prism//lib/prism/node.rb#7895 +# source://prism//lib/prism/node.rb#6925 class Prism::GlobalVariableReadNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new GlobalVariableReadNode node. # # @return [GlobalVariableReadNode] a new instance of GlobalVariableReadNode # - # source://prism//lib/prism/node.rb#7897 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#6927 + def initialize(source, node_id, location, flags, name); 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#7978 + # source://prism//lib/prism/node.rb#6992 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7904 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#6936 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7909 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6941 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7919 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#6951 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7914 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#6946 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableReadNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode # - # source://prism//lib/prism/node.rb#7924 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableReadNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#6956 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7909 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#6941 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#7932 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#6964 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -14951,7 +14307,7 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#7944 + # source://prism//lib/prism/node.rb#6976 sig { override.returns(String) } def inspect; end @@ -14961,38 +14317,19 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # $_Test # name `:$_Test` # - # source://prism//lib/prism/node.rb#7941 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#6973 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#7962 + # source://prism//lib/prism/node.rb#6981 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#7972 + # source://prism//lib/prism/node.rb#6986 def type; end end end @@ -15002,63 +14339,55 @@ end # $foo, $bar = baz # ^^^^ ^^^^ # -# source://prism//lib/prism/node.rb#7988 +# source://prism//lib/prism/node.rb#7002 class Prism::GlobalVariableTargetNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new GlobalVariableTargetNode node. # # @return [GlobalVariableTargetNode] a new instance of GlobalVariableTargetNode # - # source://prism//lib/prism/node.rb#7990 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#7004 + def initialize(source, node_id, location, flags, name); 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#8067 + # source://prism//lib/prism/node.rb#7065 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7997 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7013 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8002 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7018 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8012 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7028 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8007 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7023 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableTargetNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode # - # source://prism//lib/prism/node.rb#8017 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableTargetNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#7033 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8002 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7018 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#8025 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7041 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -15066,44 +14395,25 @@ class Prism::GlobalVariableTargetNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#8033 + # source://prism//lib/prism/node.rb#7049 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#8030 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#7046 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#8051 + # source://prism//lib/prism/node.rb#7054 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#8061 + # source://prism//lib/prism/node.rb#7059 def type; end end end @@ -15113,80 +14423,55 @@ end # $foo = 1 # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#8077 +# source://prism//lib/prism/node.rb#7075 class Prism::GlobalVariableWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # Initialize a new GlobalVariableWriteNode node. # # @return [GlobalVariableWriteNode] a new instance of GlobalVariableWriteNode # - # source://prism//lib/prism/node.rb#8079 - 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 + # source://prism//lib/prism/node.rb#7077 + def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); 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#8197 + # source://prism//lib/prism/node.rb#7179 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8089 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7089 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8094 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7094 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8104 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7104 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8099 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7099 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> GlobalVariableWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode # - # source://prism//lib/prism/node.rb#8109 - 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 + # source://prism//lib/prism/node.rb#7109 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8094 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7094 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#8117 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7117 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -15194,7 +14479,7 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#8163 + # source://prism//lib/prism/node.rb#7163 sig { override.returns(String) } def inspect; end @@ -15204,8 +14489,7 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # # $_Test = 123 # name `:$_Test` # - # source://prism//lib/prism/node.rb#8126 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#7126 def name; end # The location of the global variable's name. @@ -15213,14 +14497,12 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # $foo = :bar # ^^^^ # - # source://prism//lib/prism/node.rb#8132 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#7132 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#8158 - sig { returns(String) } + # source://prism//lib/prism/node.rb#7158 def operator; end # The location of the `=` operator. @@ -15228,26 +14510,12 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # $foo = :bar # ^ # - # source://prism//lib/prism/node.rb#8151 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#7151 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#8181 + # source://prism//lib/prism/node.rb#7168 sig { override.returns(Symbol) } def type; end @@ -15259,19 +14527,13 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # $-xyz = 123 # ^^^ # - # source://prism//lib/prism/node.rb#8145 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#7145 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#8191 + # source://prism//lib/prism/node.rb#7173 def type; end end end @@ -15281,46 +14543,34 @@ end # { a => b } # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8210 +# source://prism//lib/prism/node.rb#7192 class Prism::HashNode < ::Prism::Node - # def initialize: (Location opening_loc, Array[AssocNode | AssocSplatNode] elements, Location closing_loc, Location location) -> void + # Initialize a new HashNode node. # # @return [HashNode] a new instance of HashNode # - # source://prism//lib/prism/node.rb#8212 - 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 + # source://prism//lib/prism/node.rb#7194 + def initialize(source, node_id, location, flags, opening_loc, elements, closing_loc); 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#8327 + # source://prism//lib/prism/node.rb#7293 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8221 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7205 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8226 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7210 def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#8288 - sig { returns(String) } + # source://prism//lib/prism/node.rb#7272 def closing; end # The location of the closing brace. @@ -15328,46 +14578,33 @@ class Prism::HashNode < ::Prism::Node # { a => b } # ^ # - # source://prism//lib/prism/node.rb#8276 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#7260 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8236 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7220 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8231 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7215 def compact_child_nodes; end - # def copy: (?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location, ?location: Location) -> HashNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode # - # source://prism//lib/prism/node.rb#8241 - 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 + # source://prism//lib/prism/node.rb#7225 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8226 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7210 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location } # - # source://prism//lib/prism/node.rb#8249 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7233 def deconstruct_keys(keys); end # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. @@ -15378,8 +14615,7 @@ class Prism::HashNode < ::Prism::Node # { **foo } # ^^^^^ # - # source://prism//lib/prism/node.rb#8270 - sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) } + # source://prism//lib/prism/node.rb#7254 def elements; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -15387,14 +14623,13 @@ class Prism::HashNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#8293 + # source://prism//lib/prism/node.rb#7277 sig { override.returns(String) } def inspect; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#8283 - sig { returns(String) } + # source://prism//lib/prism/node.rb#7267 def opening; end # The location of the opening brace. @@ -15402,38 +14637,19 @@ class Prism::HashNode < ::Prism::Node # { a => b } # ^ # - # source://prism//lib/prism/node.rb#8257 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#7241 def opening_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#8311 + # source://prism//lib/prism/node.rb#7282 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#8321 + # source://prism//lib/prism/node.rb#7287 def type; end end end @@ -15446,106 +14662,75 @@ end # foo => { a: 1, b: 2, **c } # ^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8343 +# source://prism//lib/prism/node.rb#7309 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 + # Initialize a new HashPatternNode node. # # @return [HashPatternNode] a new instance of HashPatternNode # - # source://prism//lib/prism/node.rb#8345 - 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 + # source://prism//lib/prism/node.rb#7311 + def initialize(source, node_id, location, flags, constant, elements, rest, opening_loc, closing_loc); 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#8472 + # source://prism//lib/prism/node.rb#7422 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8356 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7324 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8361 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7329 def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#8433 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#7401 def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#8415 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#7383 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8375 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7343 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8366 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7334 def compact_child_nodes; end # attr_reader constant: Prism::node? # - # source://prism//lib/prism/node.rb#8393 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#7361 def constant; end - # def copy: (?constant: Prism::node?, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> HashPatternNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: Prism::node?, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode # - # source://prism//lib/prism/node.rb#8380 - 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 + # source://prism//lib/prism/node.rb#7348 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8361 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7329 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: Prism::node?, elements: Array[AssocNode], rest: AssocSplatNode | NoKeywordsParameterNode | nil, opening_loc: Location?, closing_loc: Location? } # - # source://prism//lib/prism/node.rb#8388 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7356 def deconstruct_keys(keys); end # attr_reader elements: Array[AssocNode] # - # source://prism//lib/prism/node.rb#8396 - sig { returns(T::Array[Prism::AssocNode]) } + # source://prism//lib/prism/node.rb#7364 def elements; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -15553,67 +14738,46 @@ class Prism::HashPatternNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#8438 + # source://prism//lib/prism/node.rb#7406 sig { override.returns(String) } def inspect; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#8428 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#7396 def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#8402 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#7370 def opening_loc; end # attr_reader rest: AssocSplatNode | NoKeywordsParameterNode | nil # - # source://prism//lib/prism/node.rb#8399 - sig { returns(T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode))) } + # source://prism//lib/prism/node.rb#7367 def rest; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#8456 + # source://prism//lib/prism/node.rb#7411 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#8466 + # source://prism//lib/prism/node.rb#7416 def type; end end end -# source://prism//lib/prism/node_ext.rb#49 +# source://prism//lib/prism/node_ext.rb#52 module Prism::HeredocQuery # Returns true if this node was represented as a heredoc in the source code. # # @return [Boolean] # - # source://prism//lib/prism/node_ext.rb#51 + # source://prism//lib/prism/node_ext.rb#54 def heredoc?; end end @@ -15628,108 +14792,66 @@ end # foo ? bar : baz # ^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8493 +# source://prism//lib/prism/node.rb#7443 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 + # Initialize a new IfNode node. # # @return [IfNode] a new instance of IfNode # - # source://prism//lib/prism/node.rb#8495 - 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 + # source://prism//lib/prism/node.rb#7445 + def initialize(source, node_id, location, flags, if_keyword_loc, predicate, then_keyword_loc, statements, subsequent, end_keyword_loc); 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#8687 + # source://prism//lib/prism/node.rb#7621 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8507 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7459 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8512 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7464 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8526 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7478 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8517 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7469 def compact_child_nodes; end - # Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement. - # - # if foo - # bar - # elsif baz - # ^^^^^^^^^ - # qux - # ^^^ - # end - # ^^^ - # - # if foo then bar else baz end - # ^^^^^^^^^^^^ + # Returns the subsequent if/elsif/else clause of the if node. This method is + # deprecated in favor of #subsequent. # - # source://prism//lib/prism/node.rb#8617 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node_ext.rb#485 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: ElseNode | IfNode | nil, ?end_keyword_loc: Location?) -> IfNode # - # source://prism//lib/prism/node.rb#8531 - 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 + # source://prism//lib/prism/node.rb#7483 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8512 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7464 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, if_keyword_loc: Location?, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, subsequent: ElseNode | IfNode | nil, end_keyword_loc: Location? } # - # source://prism//lib/prism/node.rb#8539 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7491 def deconstruct_keys(keys); end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#8648 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#7600 def end_keyword; end # The location of the `end` keyword if present, `nil` otherwise. @@ -15739,8 +14861,7 @@ class Prism::IfNode < ::Prism::Node # end # ^^^ # - # source://prism//lib/prism/node.rb#8625 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#7577 def end_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -15748,8 +14869,7 @@ class Prism::IfNode < ::Prism::Node # def if_keyword: () -> String? # - # source://prism//lib/prism/node.rb#8638 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#7590 def if_keyword; end # The location of the `if` keyword if present. @@ -15759,18 +14879,17 @@ class Prism::IfNode < ::Prism::Node # # The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression. # - # source://prism//lib/prism/node.rb#8549 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#7501 def if_keyword_loc; end # def inspect -> String # - # source://prism//lib/prism/node.rb#8653 + # source://prism//lib/prism/node.rb#7605 sig { override.returns(String) } def inspect; end # source://prism//lib/prism/parse_result/newlines.rb#91 - def newline!(lines); end + def newline_flag!(lines); end # The node for the condition the `IfNode` is testing. # @@ -15785,8 +14904,7 @@ class Prism::IfNode < ::Prism::Node # foo ? bar : baz # ^^^ # - # source://prism//lib/prism/node.rb#8573 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#7525 def predicate; end # Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided. @@ -15798,56 +14916,52 @@ class Prism::IfNode < ::Prism::Node # ^^^ # end # - # source://prism//lib/prism/node.rb#8602 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#7554 def statements; end - # def then_keyword: () -> String? + # Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement. # - # source://prism//lib/prism/node.rb#8643 - sig { returns(T.nilable(String)) } - def then_keyword; end - - # The location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. + # if foo + # bar + # elsif baz + # ^^^^^^^^^ + # qux + # ^^^ + # end + # ^^^ # - # if foo then bar end - # ^^^^ + # if foo then bar else baz end + # ^^^^^^^^^^^^ # - # a ? b : c - # ^ + # source://prism//lib/prism/node.rb#7569 + def subsequent; end + + # def then_keyword: () -> String? # - # source://prism//lib/prism/node.rb#8582 - sig { returns(T.nilable(Prism::Location)) } - def then_keyword_loc; end + # source://prism//lib/prism/node.rb#7595 + def then_keyword; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # The location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # if foo then bar end + # ^^^^ # - # def type: () -> Symbol + # a ? b : c + # ^ # - # source://prism//lib/prism/node.rb#8671 + # source://prism//lib/prism/node.rb#7534 + def then_keyword_loc; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # source://prism//lib/prism/node.rb#7610 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#8681 + # source://prism//lib/prism/node.rb#7615 def type; end end end @@ -15857,74 +14971,55 @@ end # 1.0i # ^^^^ # -# source://prism//lib/prism/node.rb#8702 +# source://prism//lib/prism/node.rb#7636 class Prism::ImaginaryNode < ::Prism::Node - # def initialize: (FloatNode | IntegerNode | RationalNode numeric, Location location) -> void + # Initialize a new ImaginaryNode node. # # @return [ImaginaryNode] a new instance of ImaginaryNode # - # source://prism//lib/prism/node.rb#8704 - 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 + # source://prism//lib/prism/node.rb#7638 + def initialize(source, node_id, location, flags, numeric); 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#8781 + # source://prism//lib/prism/node.rb#7699 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8711 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7647 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8716 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7652 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8726 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7662 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8721 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7657 def compact_child_nodes; end - # def copy: (?numeric: FloatNode | IntegerNode | RationalNode, ?location: Location) -> ImaginaryNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: FloatNode | IntegerNode | RationalNode) -> ImaginaryNode # - # source://prism//lib/prism/node.rb#8731 - 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 + # source://prism//lib/prism/node.rb#7667 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numeric: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8716 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7652 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: FloatNode | IntegerNode | RationalNode, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numeric: FloatNode | IntegerNode | RationalNode } # - # source://prism//lib/prism/node.rb#8739 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7675 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -15932,50 +15027,31 @@ class Prism::ImaginaryNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#8747 + # source://prism//lib/prism/node.rb#7683 sig { override.returns(String) } def inspect; end # attr_reader numeric: FloatNode | IntegerNode | RationalNode # - # source://prism//lib/prism/node.rb#8744 - sig { returns(T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode)) } + # source://prism//lib/prism/node.rb#7680 def numeric; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#8765 + # source://prism//lib/prism/node.rb#7688 sig { override.returns(Symbol) } def type; end # Returns the value of the node as a Ruby Complex. # - # source://prism//lib/prism/node_ext.rb#101 + # source://prism//lib/prism/node_ext.rb#107 sig { returns(Complex) } def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#8775 + # source://prism//lib/prism/node.rb#7693 def type; end end end @@ -15991,63 +15067,55 @@ end # foo in { bar: } # ^^^^ # -# source://prism//lib/prism/node.rb#8797 +# source://prism//lib/prism/node.rb#7715 class Prism::ImplicitNode < ::Prism::Node - # def initialize: (Prism::node value, Location location) -> void + # Initialize a new ImplicitNode node. # # @return [ImplicitNode] a new instance of ImplicitNode # - # source://prism//lib/prism/node.rb#8799 - sig { params(source: Prism::Source, value: Prism::Node, location: Prism::Location).void } - def initialize(source, value, location); end + # source://prism//lib/prism/node.rb#7717 + def initialize(source, node_id, location, flags, value); 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#8876 + # source://prism//lib/prism/node.rb#7778 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8806 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7726 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8811 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7731 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8821 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7741 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8816 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7736 def compact_child_nodes; end - # def copy: (?value: Prism::node, ?location: Location) -> ImplicitNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node) -> ImplicitNode # - # source://prism//lib/prism/node.rb#8826 - sig { params(value: Prism::Node, location: Prism::Location).returns(Prism::ImplicitNode) } - def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#7746 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8811 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7731 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#8834 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7754 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -16055,44 +15123,25 @@ class Prism::ImplicitNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#8842 + # source://prism//lib/prism/node.rb#7762 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#8860 + # source://prism//lib/prism/node.rb#7767 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#8839 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#7759 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#8870 + # source://prism//lib/prism/node.rb#7772 def type; end end end @@ -16111,63 +15160,55 @@ end # foo, = bar # ^ # -# source://prism//lib/prism/node.rb#8895 +# source://prism//lib/prism/node.rb#7797 class Prism::ImplicitRestNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new ImplicitRestNode node. # # @return [ImplicitRestNode] a new instance of ImplicitRestNode # - # source://prism//lib/prism/node.rb#8897 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#7799 + def initialize(source, node_id, location, flags); 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#8970 + # source://prism//lib/prism/node.rb#7856 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8903 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7807 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8908 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7812 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8918 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7822 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8913 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7817 def compact_child_nodes; end - # def copy: (?location: Location) -> ImplicitRestNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ImplicitRestNode # - # source://prism//lib/prism/node.rb#8923 - sig { params(location: Prism::Location).returns(Prism::ImplicitRestNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#7827 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8908 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7812 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#8931 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7835 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -16175,38 +15216,20 @@ class Prism::ImplicitRestNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#8936 + # source://prism//lib/prism/node.rb#7840 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#8954 + # source://prism//lib/prism/node.rb#7845 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#8964 + # source://prism//lib/prism/node.rb#7850 def type; end end end @@ -16216,80 +15239,55 @@ end # case a; in b then c end # ^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8979 +# source://prism//lib/prism/node.rb#7865 class Prism::InNode < ::Prism::Node - # def initialize: (Prism::node pattern, StatementsNode? statements, Location in_loc, Location? then_loc, Location location) -> void + # Initialize a new InNode node. # # @return [InNode] a new instance of InNode # - # source://prism//lib/prism/node.rb#8981 - 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 + # source://prism//lib/prism/node.rb#7867 + def initialize(source, node_id, location, flags, pattern, statements, in_loc, then_loc); 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#9097 + # source://prism//lib/prism/node.rb#7967 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8991 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#7879 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8996 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7884 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9009 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#7897 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#9001 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#7889 def compact_child_nodes; end - # def copy: (?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?, ?location: Location) -> InNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?) -> InNode # - # source://prism//lib/prism/node.rb#9014 - 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 + # source://prism//lib/prism/node.rb#7902 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8996 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#7884 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location? } # - # source://prism//lib/prism/node.rb#9022 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#7910 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -16297,74 +15295,50 @@ class Prism::InNode < ::Prism::Node # def in: () -> String # - # source://prism//lib/prism/node.rb#9053 - sig { returns(String) } + # source://prism//lib/prism/node.rb#7941 def in; end # attr_reader in_loc: Location # - # source://prism//lib/prism/node.rb#9033 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#7921 def in_loc; end # def inspect -> String # - # source://prism//lib/prism/node.rb#9063 + # source://prism//lib/prism/node.rb#7951 sig { override.returns(String) } def inspect; end # attr_reader pattern: Prism::node # - # source://prism//lib/prism/node.rb#9027 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#7915 def pattern; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#9030 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#7918 def statements; end # def then: () -> String? # - # source://prism//lib/prism/node.rb#9058 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#7946 def then; end # attr_reader then_loc: Location? # - # source://prism//lib/prism/node.rb#9040 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#7928 def then_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#9081 + # source://prism//lib/prism/node.rb#7956 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#9091 + # source://prism//lib/prism/node.rb#7961 def type; end end end @@ -16374,16 +15348,18 @@ end # foo.bar[baz] &&= value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9110 +# source://prism//lib/prism/node.rb#7980 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 + # Initialize a new IndexAndWriteNode node. # # @return [IndexAndWriteNode] a new instance of IndexAndWriteNode # - # source://prism//lib/prism/node.rb#9112 + # source://prism//lib/prism/node.rb#7982 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -16392,27 +15368,26 @@ class Prism::IndexAndWriteNode < ::Prism::Node closing_loc: Prism::Location, block: T.nilable(Prism::Node), operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).void end - def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); 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#9289 + # source://prism//lib/prism/node.rb#8138 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9127 + # source://prism//lib/prism/node.rb#7998 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#9192 + # source://prism//lib/prism/node.rb#8079 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -16420,63 +15395,65 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9225 + # source://prism//lib/prism/node.rb#8046 sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#9202 + # source://prism//lib/prism/node.rb#8089 sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#9235 + # source://prism//lib/prism/node.rb#8102 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#9172 + # source://prism//lib/prism/node.rb#8059 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9132 + # source://prism//lib/prism/node.rb#8003 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#9245 + # source://prism//lib/prism/node.rb#8112 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#9195 + # source://prism//lib/prism/node.rb#8082 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9147 + # source://prism//lib/prism/node.rb#8018 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#9137 + # source://prism//lib/prism/node.rb#8008 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode # - # source://prism//lib/prism/node.rb#9152 + # source://prism//lib/prism/node.rb#8023 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -16485,22 +15462,21 @@ class Prism::IndexAndWriteNode < ::Prism::Node closing_loc: Prism::Location, block: T.nilable(Prism::Node), operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9132 + # source://prism//lib/prism/node.rb#8003 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#9160 + # source://prism//lib/prism/node.rb#8031 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -16511,43 +15487,43 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9230 + # source://prism//lib/prism/node.rb#8051 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#9255 + # source://prism//lib/prism/node.rb#8122 sig { override.returns(String) } def inspect; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#9240 + # source://prism//lib/prism/node.rb#8107 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#9185 + # source://prism//lib/prism/node.rb#8072 sig { returns(Prism::Location) } def opening_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#9250 + # source://prism//lib/prism/node.rb#8117 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#9205 + # source://prism//lib/prism/node.rb#8092 sig { returns(Prism::Location) } def operator_loc; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#9169 + # source://prism//lib/prism/node.rb#8056 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -16555,32 +15531,19 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9215 + # source://prism//lib/prism/node.rb#8036 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#9273 + # source://prism//lib/prism/node.rb#8127 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9212 + # source://prism//lib/prism/node.rb#8099 sig { returns(Prism::Node) } def value; end @@ -16588,27 +15551,14 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9220 + # source://prism//lib/prism/node.rb#8041 sig { returns(T::Boolean) } def variable_call?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#9165 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#9283 + # source://prism//lib/prism/node.rb#8132 def type; end end end @@ -16618,16 +15568,18 @@ end # foo.bar[baz] += value # ^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9307 +# source://prism//lib/prism/node.rb#8156 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 binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void + # Initialize a new IndexOperatorWriteNode node. # # @return [IndexOperatorWriteNode] a new instance of IndexOperatorWriteNode # - # source://prism//lib/prism/node.rb#9309 + # source://prism//lib/prism/node.rb#8158 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -16637,27 +15589,26 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node block: T.nilable(Prism::Node), binary_operator: Symbol, binary_operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).void end - def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, location); end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value); 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#9485 + # source://prism//lib/prism/node.rb#8313 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9325 + # source://prism//lib/prism/node.rb#8175 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#9390 + # source://prism//lib/prism/node.rb#8256 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -16665,75 +15616,77 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9426 + # source://prism//lib/prism/node.rb#8223 sig { returns(T::Boolean) } def attribute_write?; end # attr_reader binary_operator: Symbol # - # source://prism//lib/prism/node.rb#9403 + # source://prism//lib/prism/node.rb#8269 sig { returns(Symbol) } def binary_operator; end # attr_reader binary_operator_loc: Location # - # source://prism//lib/prism/node.rb#9406 + # source://prism//lib/prism/node.rb#8272 sig { returns(Prism::Location) } def binary_operator_loc; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#9400 + # source://prism//lib/prism/node.rb#8266 sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#9436 + # source://prism//lib/prism/node.rb#8282 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#9370 + # source://prism//lib/prism/node.rb#8236 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9330 + # source://prism//lib/prism/node.rb#8180 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#9446 + # source://prism//lib/prism/node.rb#8292 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#9393 + # source://prism//lib/prism/node.rb#8259 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9345 + # source://prism//lib/prism/node.rb#8195 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#9335 + # source://prism//lib/prism/node.rb#8185 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?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOperatorWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode # - # source://prism//lib/prism/node.rb#9350 + # source://prism//lib/prism/node.rb#8200 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -16743,22 +15696,21 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node block: T.nilable(Prism::Node), binary_operator: Symbol, binary_operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).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), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9330 + # source://prism//lib/prism/node.rb#8180 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?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#9358 + # source://prism//lib/prism/node.rb#8208 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -16769,43 +15721,43 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9431 + # source://prism//lib/prism/node.rb#8228 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#9451 + # source://prism//lib/prism/node.rb#8297 sig { override.returns(String) } def inspect; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#9441 + # source://prism//lib/prism/node.rb#8287 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#9383 + # source://prism//lib/prism/node.rb#8249 sig { returns(Prism::Location) } def opening_loc; end # Returns the binary operator used to modify the receiver. This method is # deprecated in favor of #binary_operator. # - # source://prism//lib/prism/node_ext.rb#403 + # source://prism//lib/prism/node_ext.rb#419 def operator; end # Returns the location of the binary operator used to modify the receiver. # This method is deprecated in favor of #binary_operator_loc. # - # source://prism//lib/prism/node_ext.rb#410 + # source://prism//lib/prism/node_ext.rb#426 def operator_loc; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#9367 + # source://prism//lib/prism/node.rb#8233 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -16813,32 +15765,19 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9416 + # source://prism//lib/prism/node.rb#8213 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#9469 + # source://prism//lib/prism/node.rb#8302 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9413 + # source://prism//lib/prism/node.rb#8279 sig { returns(Prism::Node) } def value; end @@ -16846,27 +15785,14 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9421 + # source://prism//lib/prism/node.rb#8218 sig { returns(T::Boolean) } def variable_call?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#9363 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#9479 + # source://prism//lib/prism/node.rb#8307 def type; end end end @@ -16876,16 +15802,18 @@ end # foo.bar[baz] ||= value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9504 +# source://prism//lib/prism/node.rb#8332 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 + # Initialize a new IndexOrWriteNode node. # # @return [IndexOrWriteNode] a new instance of IndexOrWriteNode # - # source://prism//lib/prism/node.rb#9506 + # source://prism//lib/prism/node.rb#8334 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -16894,27 +15822,26 @@ class Prism::IndexOrWriteNode < ::Prism::Node closing_loc: Prism::Location, block: T.nilable(Prism::Node), operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).void end - def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); 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#9683 + # source://prism//lib/prism/node.rb#8490 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9521 + # source://prism//lib/prism/node.rb#8350 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#9586 + # source://prism//lib/prism/node.rb#8431 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -16922,63 +15849,65 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9619 + # source://prism//lib/prism/node.rb#8398 sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#9596 + # source://prism//lib/prism/node.rb#8441 sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#9629 + # source://prism//lib/prism/node.rb#8454 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#9566 + # source://prism//lib/prism/node.rb#8411 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9526 + # source://prism//lib/prism/node.rb#8355 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#9639 + # source://prism//lib/prism/node.rb#8464 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#9589 + # source://prism//lib/prism/node.rb#8434 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9541 + # source://prism//lib/prism/node.rb#8370 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#9531 + # source://prism//lib/prism/node.rb#8360 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode # - # source://prism//lib/prism/node.rb#9546 + # source://prism//lib/prism/node.rb#8375 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), @@ -16987,22 +15916,21 @@ class Prism::IndexOrWriteNode < ::Prism::Node closing_loc: Prism::Location, block: T.nilable(Prism::Node), operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9526 + # source://prism//lib/prism/node.rb#8355 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#9554 + # source://prism//lib/prism/node.rb#8383 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -17013,43 +15941,43 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9624 + # source://prism//lib/prism/node.rb#8403 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#9649 + # source://prism//lib/prism/node.rb#8474 sig { override.returns(String) } def inspect; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#9634 + # source://prism//lib/prism/node.rb#8459 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#9579 + # source://prism//lib/prism/node.rb#8424 sig { returns(Prism::Location) } def opening_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#9644 + # source://prism//lib/prism/node.rb#8469 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#9599 + # source://prism//lib/prism/node.rb#8444 sig { returns(Prism::Location) } def operator_loc; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#9563 + # source://prism//lib/prism/node.rb#8408 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -17057,32 +15985,19 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9609 + # source://prism//lib/prism/node.rb#8388 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#9667 + # source://prism//lib/prism/node.rb#8479 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9606 + # source://prism//lib/prism/node.rb#8451 sig { returns(Prism::Node) } def value; end @@ -17090,27 +16005,14 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9614 + # source://prism//lib/prism/node.rb#8393 sig { returns(T::Boolean) } def variable_call?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#9559 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#9677 + # source://prism//lib/prism/node.rb#8484 def type; end end end @@ -17128,42 +16030,43 @@ end # for foo[bar] in baz do end # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#9709 +# source://prism//lib/prism/node.rb#8516 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 + # Initialize a new IndexTargetNode node. # # @return [IndexTargetNode] a new instance of IndexTargetNode # - # source://prism//lib/prism/node.rb#9711 + # source://prism//lib/prism/node.rb#8518 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, 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 + block: T.nilable(Prism::Node) ).void end - def initialize(source, flags, receiver, opening_loc, arguments, closing_loc, block, location); end + def initialize(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block); 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#9851 + # source://prism//lib/prism/node.rb#8637 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9723 + # source://prism//lib/prism/node.rb#8531 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#9774 + # source://prism//lib/prism/node.rb#8598 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -17171,72 +16074,73 @@ class Prism::IndexTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9797 + # source://prism//lib/prism/node.rb#8578 sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#9784 + # source://prism//lib/prism/node.rb#8608 sig { returns(T.nilable(Prism::Node)) } def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9728 + # source://prism//lib/prism/node.rb#8536 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#9812 + # source://prism//lib/prism/node.rb#8616 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#9777 + # source://prism//lib/prism/node.rb#8601 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9742 + # source://prism//lib/prism/node.rb#8550 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#9733 + # source://prism//lib/prism/node.rb#8541 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?) -> IndexTargetNode # - # source://prism//lib/prism/node.rb#9747 + # source://prism//lib/prism/node.rb#8555 sig do params( + node_id: Integer, + location: Prism::Location, 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 + block: T.nilable(Prism::Node) ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9728 + # source://prism//lib/prism/node.rb#8536 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node? } # - # source://prism//lib/prism/node.rb#9755 + # source://prism//lib/prism/node.rb#8563 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -17247,31 +16151,31 @@ class Prism::IndexTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9802 + # source://prism//lib/prism/node.rb#8583 sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#9817 + # source://prism//lib/prism/node.rb#8621 sig { override.returns(String) } def inspect; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#9807 + # source://prism//lib/prism/node.rb#8611 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#9767 + # source://prism//lib/prism/node.rb#8591 sig { returns(Prism::Location) } def opening_loc; end # attr_reader receiver: Prism::node # - # source://prism//lib/prism/node.rb#9764 + # source://prism//lib/prism/node.rb#8588 sig { returns(Prism::Node) } def receiver; end @@ -17279,26 +16183,13 @@ class Prism::IndexTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9787 + # source://prism//lib/prism/node.rb#8568 sig { returns(T::Boolean) } def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#9835 + # source://prism//lib/prism/node.rb#8626 sig { override.returns(Symbol) } def type; end @@ -17306,27 +16197,14 @@ class Prism::IndexTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9792 + # source://prism//lib/prism/node.rb#8573 sig { returns(T::Boolean) } def variable_call?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#9760 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#9845 + # source://prism//lib/prism/node.rb#8631 def type; end end end @@ -17334,11 +16212,11 @@ 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#388 +# source://prism//lib/prism/parse_result.rb#397 class Prism::InlineComment < ::Prism::Comment # Returns a string representation of this comment. # - # source://prism//lib/prism/parse_result.rb#396 + # source://prism//lib/prism/parse_result.rb#405 sig { returns(String) } def inspect; end @@ -17347,7 +16225,7 @@ class Prism::InlineComment < ::Prism::Comment # # @return [Boolean] # - # source://prism//lib/prism/parse_result.rb#391 + # source://prism//lib/prism/parse_result.rb#400 sig { override.returns(T::Boolean) } def trailing?; end end @@ -17389,764 +16267,764 @@ class Prism::InspectVisitor < ::Prism::Visitor # Inspect a AliasMethodNode node. # - # source://prism//lib/prism/inspect_visitor.rb#87 + # source://prism//lib/prism/inspect_visitor.rb#89 def visit_alias_method_node(node); end # Inspect a AlternationPatternNode node. # - # source://prism//lib/prism/inspect_visitor.rb#97 + # source://prism//lib/prism/inspect_visitor.rb#101 def visit_alternation_pattern_node(node); end # Inspect a AndNode node. # - # source://prism//lib/prism/inspect_visitor.rb#107 + # source://prism//lib/prism/inspect_visitor.rb#113 def visit_and_node(node); end # Inspect a ArgumentsNode node. # - # source://prism//lib/prism/inspect_visitor.rb#117 + # source://prism//lib/prism/inspect_visitor.rb#125 def visit_arguments_node(node); end # Inspect a ArrayNode node. # - # source://prism//lib/prism/inspect_visitor.rb#133 + # source://prism//lib/prism/inspect_visitor.rb#141 def visit_array_node(node); end # Inspect a ArrayPatternNode node. # - # source://prism//lib/prism/inspect_visitor.rb#151 + # source://prism//lib/prism/inspect_visitor.rb#159 def visit_array_pattern_node(node); end # Inspect a AssocNode node. # - # source://prism//lib/prism/inspect_visitor.rb#188 + # source://prism//lib/prism/inspect_visitor.rb#198 def visit_assoc_node(node); end # Inspect a AssocSplatNode node. # - # source://prism//lib/prism/inspect_visitor.rb#198 + # source://prism//lib/prism/inspect_visitor.rb#210 def visit_assoc_splat_node(node); end # Inspect a BackReferenceReadNode node. # - # source://prism//lib/prism/inspect_visitor.rb#210 + # source://prism//lib/prism/inspect_visitor.rb#224 def visit_back_reference_read_node(node); end # Inspect a BeginNode node. # - # source://prism//lib/prism/inspect_visitor.rb#216 + # source://prism//lib/prism/inspect_visitor.rb#232 def visit_begin_node(node); end # Inspect a BlockArgumentNode node. # - # source://prism//lib/prism/inspect_visitor.rb#247 + # source://prism//lib/prism/inspect_visitor.rb#265 def visit_block_argument_node(node); end # Inspect a BlockLocalVariableNode node. # - # source://prism//lib/prism/inspect_visitor.rb#259 + # source://prism//lib/prism/inspect_visitor.rb#279 def visit_block_local_variable_node(node); end # Inspect a BlockNode node. # - # source://prism//lib/prism/inspect_visitor.rb#267 + # source://prism//lib/prism/inspect_visitor.rb#287 def visit_block_node(node); end # Inspect a BlockParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#287 + # source://prism//lib/prism/inspect_visitor.rb#309 def visit_block_parameter_node(node); end # Inspect a BlockParametersNode node. # - # source://prism//lib/prism/inspect_visitor.rb#301 + # source://prism//lib/prism/inspect_visitor.rb#323 def visit_block_parameters_node(node); end # Inspect a BreakNode node. # - # source://prism//lib/prism/inspect_visitor.rb#323 + # source://prism//lib/prism/inspect_visitor.rb#347 def visit_break_node(node); end # Inspect a CallAndWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#335 + # source://prism//lib/prism/inspect_visitor.rb#361 def visit_call_and_write_node(node); end # Inspect a CallNode node. # - # source://prism//lib/prism/inspect_visitor.rb#355 + # source://prism//lib/prism/inspect_visitor.rb#381 def visit_call_node(node); end # Inspect a CallOperatorWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#385 + # source://prism//lib/prism/inspect_visitor.rb#411 def visit_call_operator_write_node(node); end # Inspect a CallOrWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#406 + # source://prism//lib/prism/inspect_visitor.rb#432 def visit_call_or_write_node(node); end # Inspect a CallTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#426 + # source://prism//lib/prism/inspect_visitor.rb#452 def visit_call_target_node(node); end # Inspect a CapturePatternNode node. # - # source://prism//lib/prism/inspect_visitor.rb#438 + # source://prism//lib/prism/inspect_visitor.rb#464 def visit_capture_pattern_node(node); end # Inspect a CaseMatchNode node. # - # source://prism//lib/prism/inspect_visitor.rb#448 + # source://prism//lib/prism/inspect_visitor.rb#476 def visit_case_match_node(node); end # Inspect a CaseNode node. # - # source://prism//lib/prism/inspect_visitor.rb#476 + # source://prism//lib/prism/inspect_visitor.rb#506 def visit_case_node(node); end # Inspect a ClassNode node. # - # source://prism//lib/prism/inspect_visitor.rb#504 + # source://prism//lib/prism/inspect_visitor.rb#536 def visit_class_node(node); end # Inspect a ClassVariableAndWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#528 + # source://prism//lib/prism/inspect_visitor.rb#562 def visit_class_variable_and_write_node(node); end # Inspect a ClassVariableOperatorWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#538 + # source://prism//lib/prism/inspect_visitor.rb#574 def visit_class_variable_operator_write_node(node); end # Inspect a ClassVariableOrWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#549 + # source://prism//lib/prism/inspect_visitor.rb#587 def visit_class_variable_or_write_node(node); end # Inspect a ClassVariableReadNode node. # - # source://prism//lib/prism/inspect_visitor.rb#559 + # source://prism//lib/prism/inspect_visitor.rb#599 def visit_class_variable_read_node(node); end # Inspect a ClassVariableTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#565 + # source://prism//lib/prism/inspect_visitor.rb#607 def visit_class_variable_target_node(node); end # Inspect a ClassVariableWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#571 + # source://prism//lib/prism/inspect_visitor.rb#615 def visit_class_variable_write_node(node); end # Inspect a ConstantAndWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#581 + # source://prism//lib/prism/inspect_visitor.rb#627 def visit_constant_and_write_node(node); end # Inspect a ConstantOperatorWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#591 + # source://prism//lib/prism/inspect_visitor.rb#639 def visit_constant_operator_write_node(node); end # Inspect a ConstantOrWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#602 + # source://prism//lib/prism/inspect_visitor.rb#652 def visit_constant_or_write_node(node); end # Inspect a ConstantPathAndWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#612 + # source://prism//lib/prism/inspect_visitor.rb#664 def visit_constant_path_and_write_node(node); end # Inspect a ConstantPathNode node. # - # source://prism//lib/prism/inspect_visitor.rb#622 + # source://prism//lib/prism/inspect_visitor.rb#676 def visit_constant_path_node(node); end # Inspect a ConstantPathOperatorWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#640 + # source://prism//lib/prism/inspect_visitor.rb#696 def visit_constant_path_operator_write_node(node); end # Inspect a ConstantPathOrWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#651 + # source://prism//lib/prism/inspect_visitor.rb#709 def visit_constant_path_or_write_node(node); end # Inspect a ConstantPathTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#661 + # source://prism//lib/prism/inspect_visitor.rb#721 def visit_constant_path_target_node(node); end # Inspect a ConstantPathWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#679 + # source://prism//lib/prism/inspect_visitor.rb#741 def visit_constant_path_write_node(node); end # Inspect a ConstantReadNode node. # - # source://prism//lib/prism/inspect_visitor.rb#689 + # source://prism//lib/prism/inspect_visitor.rb#753 def visit_constant_read_node(node); end # Inspect a ConstantTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#695 + # source://prism//lib/prism/inspect_visitor.rb#761 def visit_constant_target_node(node); end # Inspect a ConstantWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#701 + # source://prism//lib/prism/inspect_visitor.rb#769 def visit_constant_write_node(node); end # Inspect a DefNode node. # - # source://prism//lib/prism/inspect_visitor.rb#711 + # source://prism//lib/prism/inspect_visitor.rb#781 def visit_def_node(node); end # Inspect a DefinedNode node. # - # source://prism//lib/prism/inspect_visitor.rb#743 + # source://prism//lib/prism/inspect_visitor.rb#815 def visit_defined_node(node); end # Inspect a ElseNode node. # - # source://prism//lib/prism/inspect_visitor.rb#753 + # source://prism//lib/prism/inspect_visitor.rb#827 def visit_else_node(node); end # Inspect a EmbeddedStatementsNode node. # - # source://prism//lib/prism/inspect_visitor.rb#766 + # source://prism//lib/prism/inspect_visitor.rb#842 def visit_embedded_statements_node(node); end # Inspect a EmbeddedVariableNode node. # - # source://prism//lib/prism/inspect_visitor.rb#779 + # source://prism//lib/prism/inspect_visitor.rb#857 def visit_embedded_variable_node(node); end # Inspect a EnsureNode node. # - # source://prism//lib/prism/inspect_visitor.rb#787 + # source://prism//lib/prism/inspect_visitor.rb#867 def visit_ensure_node(node); end # Inspect a FalseNode node. # - # source://prism//lib/prism/inspect_visitor.rb#800 + # source://prism//lib/prism/inspect_visitor.rb#882 def visit_false_node(node); end # Inspect a FindPatternNode node. # - # source://prism//lib/prism/inspect_visitor.rb#805 + # source://prism//lib/prism/inspect_visitor.rb#889 def visit_find_pattern_node(node); end # Inspect a FlipFlopNode node. # - # source://prism//lib/prism/inspect_visitor.rb#831 + # source://prism//lib/prism/inspect_visitor.rb#917 def visit_flip_flop_node(node); end # Inspect a FloatNode node. # - # source://prism//lib/prism/inspect_visitor.rb#851 + # source://prism//lib/prism/inspect_visitor.rb#937 def visit_float_node(node); end # Inspect a ForNode node. # - # source://prism//lib/prism/inspect_visitor.rb#857 + # source://prism//lib/prism/inspect_visitor.rb#945 def visit_for_node(node); end # Inspect a ForwardingArgumentsNode node. # - # source://prism//lib/prism/inspect_visitor.rb#876 + # source://prism//lib/prism/inspect_visitor.rb#966 def visit_forwarding_arguments_node(node); end # Inspect a ForwardingParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#881 + # source://prism//lib/prism/inspect_visitor.rb#973 def visit_forwarding_parameter_node(node); end # Inspect a ForwardingSuperNode node. # - # source://prism//lib/prism/inspect_visitor.rb#886 + # source://prism//lib/prism/inspect_visitor.rb#980 def visit_forwarding_super_node(node); end # Inspect a GlobalVariableAndWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#897 + # source://prism//lib/prism/inspect_visitor.rb#993 def visit_global_variable_and_write_node(node); end # Inspect a GlobalVariableOperatorWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#907 + # source://prism//lib/prism/inspect_visitor.rb#1005 def visit_global_variable_operator_write_node(node); end # Inspect a GlobalVariableOrWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#918 + # source://prism//lib/prism/inspect_visitor.rb#1018 def visit_global_variable_or_write_node(node); end # Inspect a GlobalVariableReadNode node. # - # source://prism//lib/prism/inspect_visitor.rb#928 + # source://prism//lib/prism/inspect_visitor.rb#1030 def visit_global_variable_read_node(node); end # Inspect a GlobalVariableTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#934 + # source://prism//lib/prism/inspect_visitor.rb#1038 def visit_global_variable_target_node(node); end # Inspect a GlobalVariableWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#940 + # source://prism//lib/prism/inspect_visitor.rb#1046 def visit_global_variable_write_node(node); end # Inspect a HashNode node. # - # source://prism//lib/prism/inspect_visitor.rb#950 + # source://prism//lib/prism/inspect_visitor.rb#1058 def visit_hash_node(node); end # Inspect a HashPatternNode node. # - # source://prism//lib/prism/inspect_visitor.rb#966 + # source://prism//lib/prism/inspect_visitor.rb#1076 def visit_hash_pattern_node(node); end # Inspect a IfNode node. # - # source://prism//lib/prism/inspect_visitor.rb#994 + # source://prism//lib/prism/inspect_visitor.rb#1106 def visit_if_node(node); end # Inspect a ImaginaryNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1016 + # source://prism//lib/prism/inspect_visitor.rb#1130 def visit_imaginary_node(node); end # Inspect a ImplicitNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1023 + # source://prism//lib/prism/inspect_visitor.rb#1139 def visit_implicit_node(node); end # Inspect a ImplicitRestNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1030 + # source://prism//lib/prism/inspect_visitor.rb#1148 def visit_implicit_rest_node(node); end # Inspect a InNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1035 + # source://prism//lib/prism/inspect_visitor.rb#1155 def visit_in_node(node); end # Inspect a IndexAndWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1050 + # source://prism//lib/prism/inspect_visitor.rb#1172 def visit_index_and_write_node(node); end # Inspect a IndexOperatorWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1081 + # source://prism//lib/prism/inspect_visitor.rb#1203 def visit_index_operator_write_node(node); end # Inspect a IndexOrWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1113 + # source://prism//lib/prism/inspect_visitor.rb#1235 def visit_index_or_write_node(node); end # Inspect a IndexTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1144 + # source://prism//lib/prism/inspect_visitor.rb#1266 def visit_index_target_node(node); end # Inspect a InstanceVariableAndWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1167 + # source://prism//lib/prism/inspect_visitor.rb#1289 def visit_instance_variable_and_write_node(node); end # Inspect a InstanceVariableOperatorWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1177 + # source://prism//lib/prism/inspect_visitor.rb#1301 def visit_instance_variable_operator_write_node(node); end # Inspect a InstanceVariableOrWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1188 + # source://prism//lib/prism/inspect_visitor.rb#1314 def visit_instance_variable_or_write_node(node); end # Inspect a InstanceVariableReadNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1198 + # source://prism//lib/prism/inspect_visitor.rb#1326 def visit_instance_variable_read_node(node); end # Inspect a InstanceVariableTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1204 + # source://prism//lib/prism/inspect_visitor.rb#1334 def visit_instance_variable_target_node(node); end # Inspect a InstanceVariableWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1210 + # source://prism//lib/prism/inspect_visitor.rb#1342 def visit_instance_variable_write_node(node); end # Inspect a IntegerNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1220 + # source://prism//lib/prism/inspect_visitor.rb#1354 def visit_integer_node(node); end # Inspect a InterpolatedMatchLastLineNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1228 + # source://prism//lib/prism/inspect_visitor.rb#1362 def visit_interpolated_match_last_line_node(node); end # Inspect a InterpolatedRegularExpressionNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1246 + # source://prism//lib/prism/inspect_visitor.rb#1380 def visit_interpolated_regular_expression_node(node); end # Inspect a InterpolatedStringNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1264 + # source://prism//lib/prism/inspect_visitor.rb#1398 def visit_interpolated_string_node(node); end # Inspect a InterpolatedSymbolNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1282 + # source://prism//lib/prism/inspect_visitor.rb#1416 def visit_interpolated_symbol_node(node); end # Inspect a InterpolatedXStringNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1298 + # source://prism//lib/prism/inspect_visitor.rb#1434 def visit_interpolated_x_string_node(node); end # Inspect a ItLocalVariableReadNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1314 + # source://prism//lib/prism/inspect_visitor.rb#1452 def visit_it_local_variable_read_node(node); end # Inspect a ItParametersNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1319 + # source://prism//lib/prism/inspect_visitor.rb#1459 def visit_it_parameters_node(node); end # Inspect a KeywordHashNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1324 + # source://prism//lib/prism/inspect_visitor.rb#1466 def visit_keyword_hash_node(node); end # Inspect a KeywordRestParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1340 + # source://prism//lib/prism/inspect_visitor.rb#1482 def visit_keyword_rest_parameter_node(node); end # Inspect a LambdaNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1354 + # source://prism//lib/prism/inspect_visitor.rb#1496 def visit_lambda_node(node); end # Inspect a LocalVariableAndWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1375 + # source://prism//lib/prism/inspect_visitor.rb#1519 def visit_local_variable_and_write_node(node); end # Inspect a LocalVariableOperatorWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1386 + # source://prism//lib/prism/inspect_visitor.rb#1532 def visit_local_variable_operator_write_node(node); end # Inspect a LocalVariableOrWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1398 + # source://prism//lib/prism/inspect_visitor.rb#1546 def visit_local_variable_or_write_node(node); end # Inspect a LocalVariableReadNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1409 + # source://prism//lib/prism/inspect_visitor.rb#1559 def visit_local_variable_read_node(node); end # Inspect a LocalVariableTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1416 + # source://prism//lib/prism/inspect_visitor.rb#1568 def visit_local_variable_target_node(node); end # Inspect a LocalVariableWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1423 + # source://prism//lib/prism/inspect_visitor.rb#1577 def visit_local_variable_write_node(node); end # Inspect a MatchLastLineNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1434 + # source://prism//lib/prism/inspect_visitor.rb#1590 def visit_match_last_line_node(node); end # Inspect a MatchPredicateNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1445 + # source://prism//lib/prism/inspect_visitor.rb#1601 def visit_match_predicate_node(node); end # Inspect a MatchRequiredNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1455 + # source://prism//lib/prism/inspect_visitor.rb#1613 def visit_match_required_node(node); end # Inspect a MatchWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1465 + # source://prism//lib/prism/inspect_visitor.rb#1625 def visit_match_write_node(node); end # Inspect a MissingNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1481 + # source://prism//lib/prism/inspect_visitor.rb#1643 def visit_missing_node(node); end # Inspect a ModuleNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1486 + # source://prism//lib/prism/inspect_visitor.rb#1650 def visit_module_node(node); end # Inspect a MultiTargetNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1503 + # source://prism//lib/prism/inspect_visitor.rb#1669 def visit_multi_target_node(node); end # Inspect a MultiWriteNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1534 + # source://prism//lib/prism/inspect_visitor.rb#1702 def visit_multi_write_node(node); end # Inspect a NextNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1568 + # source://prism//lib/prism/inspect_visitor.rb#1738 def visit_next_node(node); end # Inspect a NilNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1580 + # source://prism//lib/prism/inspect_visitor.rb#1752 def visit_nil_node(node); end # Inspect a NoKeywordsParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1585 + # source://prism//lib/prism/inspect_visitor.rb#1759 def visit_no_keywords_parameter_node(node); end # Inspect a NumberedParametersNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1592 + # source://prism//lib/prism/inspect_visitor.rb#1768 def visit_numbered_parameters_node(node); end # Inspect a NumberedReferenceReadNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1598 + # source://prism//lib/prism/inspect_visitor.rb#1776 def visit_numbered_reference_read_node(node); end # Inspect a OptionalKeywordParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1604 + # source://prism//lib/prism/inspect_visitor.rb#1784 def visit_optional_keyword_parameter_node(node); end # Inspect a OptionalParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1615 + # source://prism//lib/prism/inspect_visitor.rb#1795 def visit_optional_parameter_node(node); end # Inspect a OrNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1627 + # source://prism//lib/prism/inspect_visitor.rb#1807 def visit_or_node(node); end # Inspect a ParametersNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1637 + # source://prism//lib/prism/inspect_visitor.rb#1819 def visit_parameters_node(node); end # Inspect a ParenthesesNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1696 + # source://prism//lib/prism/inspect_visitor.rb#1880 def visit_parentheses_node(node); end # Inspect a PinnedExpressionNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1709 + # source://prism//lib/prism/inspect_visitor.rb#1895 def visit_pinned_expression_node(node); end # Inspect a PinnedVariableNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1719 + # source://prism//lib/prism/inspect_visitor.rb#1907 def visit_pinned_variable_node(node); end # Inspect a PostExecutionNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1727 + # source://prism//lib/prism/inspect_visitor.rb#1917 def visit_post_execution_node(node); end # Inspect a PreExecutionNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1741 + # source://prism//lib/prism/inspect_visitor.rb#1933 def visit_pre_execution_node(node); end # Inspect a ProgramNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1755 + # source://prism//lib/prism/inspect_visitor.rb#1949 def visit_program_node(node); end # Inspect a RangeNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1763 + # source://prism//lib/prism/inspect_visitor.rb#1959 def visit_range_node(node); end # Inspect a RationalNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1783 + # source://prism//lib/prism/inspect_visitor.rb#1979 def visit_rational_node(node); end # Inspect a RedoNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1792 + # source://prism//lib/prism/inspect_visitor.rb#1988 def visit_redo_node(node); end # Inspect a RegularExpressionNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1797 + # source://prism//lib/prism/inspect_visitor.rb#1995 def visit_regular_expression_node(node); end # Inspect a RequiredKeywordParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1808 + # source://prism//lib/prism/inspect_visitor.rb#2006 def visit_required_keyword_parameter_node(node); end # Inspect a RequiredParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1817 + # source://prism//lib/prism/inspect_visitor.rb#2015 def visit_required_parameter_node(node); end # Inspect a RescueModifierNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1825 + # source://prism//lib/prism/inspect_visitor.rb#2023 def visit_rescue_modifier_node(node); end # Inspect a RescueNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1835 + # source://prism//lib/prism/inspect_visitor.rb#2035 def visit_rescue_node(node); end # Inspect a RestParameterNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1869 + # source://prism//lib/prism/inspect_visitor.rb#2071 def visit_rest_parameter_node(node); end # Inspect a RetryNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1883 + # source://prism//lib/prism/inspect_visitor.rb#2085 def visit_retry_node(node); end # Inspect a ReturnNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1888 + # source://prism//lib/prism/inspect_visitor.rb#2092 def visit_return_node(node); end # Inspect a SelfNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1902 + # source://prism//lib/prism/inspect_visitor.rb#2106 def visit_self_node(node); end # Inspect a ShareableConstantNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1907 + # source://prism//lib/prism/inspect_visitor.rb#2113 def visit_shareable_constant_node(node); end # Inspect a SingletonClassNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1916 + # source://prism//lib/prism/inspect_visitor.rb#2122 def visit_singleton_class_node(node); end # Inspect a SourceEncodingNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1933 + # source://prism//lib/prism/inspect_visitor.rb#2141 def visit_source_encoding_node(node); end # Inspect a SourceFileNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1938 + # source://prism//lib/prism/inspect_visitor.rb#2148 def visit_source_file_node(node); end # Inspect a SourceLineNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1946 + # source://prism//lib/prism/inspect_visitor.rb#2156 def visit_source_line_node(node); end # Inspect a SplatNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1951 + # source://prism//lib/prism/inspect_visitor.rb#2163 def visit_splat_node(node); end # Inspect a StatementsNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1963 + # source://prism//lib/prism/inspect_visitor.rb#2177 def visit_statements_node(node); end # Inspect a StringNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1977 + # source://prism//lib/prism/inspect_visitor.rb#2193 def visit_string_node(node); end # Inspect a SuperNode node. # - # source://prism//lib/prism/inspect_visitor.rb#1988 + # source://prism//lib/prism/inspect_visitor.rb#2204 def visit_super_node(node); end # Inspect a SymbolNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2008 + # source://prism//lib/prism/inspect_visitor.rb#2226 def visit_symbol_node(node); end # Inspect a TrueNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2019 + # source://prism//lib/prism/inspect_visitor.rb#2237 def visit_true_node(node); end # Inspect a UndefNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2024 + # source://prism//lib/prism/inspect_visitor.rb#2244 def visit_undef_node(node); end # Inspect a UnlessNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2039 + # source://prism//lib/prism/inspect_visitor.rb#2261 def visit_unless_node(node); end # Inspect a UntilNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2061 + # source://prism//lib/prism/inspect_visitor.rb#2285 def visit_until_node(node); end # Inspect a WhenNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2078 + # source://prism//lib/prism/inspect_visitor.rb#2302 def visit_when_node(node); end # Inspect a WhileNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2100 + # source://prism//lib/prism/inspect_visitor.rb#2326 def visit_while_node(node); end # Inspect a XStringNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2117 + # source://prism//lib/prism/inspect_visitor.rb#2343 def visit_x_string_node(node); end # Inspect a YieldNode node. # - # source://prism//lib/prism/inspect_visitor.rb#2128 + # source://prism//lib/prism/inspect_visitor.rb#2354 def visit_yield_node(node); end private # Compose a string representing the given inner location field. # - # source://prism//lib/prism/inspect_visitor.rb#2150 + # source://prism//lib/prism/inspect_visitor.rb#2378 def inspect_location(location); end # Compose a header for the given node. # - # source://prism//lib/prism/inspect_visitor.rb#2144 + # source://prism//lib/prism/inspect_visitor.rb#2372 def inspect_node(name, node); end class << self @@ -18179,83 +17057,58 @@ end # @target &&= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9866 +# source://prism//lib/prism/node.rb#8652 class Prism::InstanceVariableAndWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new InstanceVariableAndWriteNode node. # # @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode # - # source://prism//lib/prism/node.rb#9868 - 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 + # source://prism//lib/prism/node.rb#8654 + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#9970 + # source://prism//lib/prism/node.rb#8740 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9878 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#8666 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9883 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#8671 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9893 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#8681 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#9888 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#8676 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableAndWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode # - # source://prism//lib/prism/node.rb#9898 - 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 + # source://prism//lib/prism/node.rb#8686 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9883 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#8671 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#9906 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#8694 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#181 + # source://prism//lib/prism/desugar_compiler.rb#218 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -18263,68 +17116,45 @@ class Prism::InstanceVariableAndWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#9936 + # source://prism//lib/prism/node.rb#8724 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#9911 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#8699 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#9914 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#8702 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#9931 - sig { returns(String) } + # source://prism//lib/prism/node.rb#8719 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#9921 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#8709 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#9954 + # source://prism//lib/prism/node.rb#8729 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9928 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#8716 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#9964 + # source://prism//lib/prism/node.rb#8734 def type; end end end @@ -18334,97 +17164,68 @@ end # @target += value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9983 +# source://prism//lib/prism/node.rb#8753 class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # Initialize a new InstanceVariableOperatorWriteNode node. # # @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#9985 - sig do - params( - source: Prism::Source, - name: Symbol, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).void - end - def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end + # source://prism//lib/prism/node.rb#8755 + def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); 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#10086 + # source://prism//lib/prism/node.rb#8840 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9996 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#8768 def accept(visitor); end # attr_reader binary_operator: Symbol # - # source://prism//lib/prism/node.rb#10049 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#8821 def binary_operator; end # attr_reader binary_operator_loc: Location # - # source://prism//lib/prism/node.rb#10039 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#8811 def binary_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10001 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#8773 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10011 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#8783 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10006 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#8778 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#10016 - sig do - params( - name: Symbol, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - binary_operator: Symbol, - location: Prism::Location - ).returns(Prism::InstanceVariableOperatorWriteNode) - end - def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#8788 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10001 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#8773 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } # - # source://prism//lib/prism/node.rb#10024 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#8796 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#193 + # source://prism//lib/prism/desugar_compiler.rb#230 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -18432,68 +17233,47 @@ class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#10052 + # source://prism//lib/prism/node.rb#8824 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#10029 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#8801 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#10032 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#8804 def name_loc; end # Returns the binary operator used to modify the receiver. This method is # deprecated in favor of #binary_operator. # - # source://prism//lib/prism/node_ext.rb#419 + # source://prism//lib/prism/node_ext.rb#435 def operator; end # Returns the location of the binary operator used to modify the receiver. # This method is deprecated in favor of #binary_operator_loc. # - # source://prism//lib/prism/node_ext.rb#426 + # source://prism//lib/prism/node_ext.rb#442 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#10070 + # source://prism//lib/prism/node.rb#8829 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#10046 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#8818 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#10080 + # source://prism//lib/prism/node.rb#8834 def type; end end end @@ -18503,83 +17283,58 @@ end # @target ||= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#10100 +# source://prism//lib/prism/node.rb#8854 class Prism::InstanceVariableOrWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new InstanceVariableOrWriteNode node. # # @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode # - # source://prism//lib/prism/node.rb#10102 - 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 + # source://prism//lib/prism/node.rb#8856 + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#10204 + # source://prism//lib/prism/node.rb#8942 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10112 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#8868 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10117 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#8873 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10127 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#8883 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10122 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#8878 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableOrWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode # - # source://prism//lib/prism/node.rb#10132 - 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 + # source://prism//lib/prism/node.rb#8888 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10117 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#8873 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#10140 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#8896 def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#187 + # source://prism//lib/prism/desugar_compiler.rb#224 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -18587,68 +17342,45 @@ class Prism::InstanceVariableOrWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#10170 + # source://prism//lib/prism/node.rb#8926 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#10145 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#8901 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#10148 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#8904 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#10165 - sig { returns(String) } + # source://prism//lib/prism/node.rb#8921 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#10155 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#8911 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#10188 + # source://prism//lib/prism/node.rb#8931 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#10162 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#8918 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#10198 + # source://prism//lib/prism/node.rb#8936 def type; end end end @@ -18658,63 +17390,55 @@ end # @foo # ^^^^ # -# source://prism//lib/prism/node.rb#10217 +# source://prism//lib/prism/node.rb#8955 class Prism::InstanceVariableReadNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new InstanceVariableReadNode node. # # @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode # - # source://prism//lib/prism/node.rb#10219 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#8957 + def initialize(source, node_id, location, flags, name); 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#10300 + # source://prism//lib/prism/node.rb#9022 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10226 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#8966 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10231 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#8971 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10241 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#8981 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10236 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#8976 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableReadNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode # - # source://prism//lib/prism/node.rb#10246 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableReadNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#8986 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10231 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#8971 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#10254 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#8994 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -18722,7 +17446,7 @@ class Prism::InstanceVariableReadNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#10266 + # source://prism//lib/prism/node.rb#9006 sig { override.returns(String) } def inspect; end @@ -18732,38 +17456,19 @@ class Prism::InstanceVariableReadNode < ::Prism::Node # # @_test # name `:@_test` # - # source://prism//lib/prism/node.rb#10263 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#9003 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#10284 + # source://prism//lib/prism/node.rb#9011 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#10294 + # source://prism//lib/prism/node.rb#9016 def type; end end end @@ -18773,63 +17478,55 @@ end # @foo, @bar = baz # ^^^^ ^^^^ # -# source://prism//lib/prism/node.rb#10310 +# source://prism//lib/prism/node.rb#9032 class Prism::InstanceVariableTargetNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Initialize a new InstanceVariableTargetNode node. # # @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode # - # source://prism//lib/prism/node.rb#10312 - sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } - def initialize(source, name, location); end + # source://prism//lib/prism/node.rb#9034 + def initialize(source, node_id, location, flags, name); 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#10389 + # source://prism//lib/prism/node.rb#9095 def ===(other); end # def accept: (Visitor visitor) -> void - # - # source://prism//lib/prism/node.rb#10319 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # + # source://prism//lib/prism/node.rb#9043 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10324 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9048 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10334 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#9058 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10329 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#9053 def compact_child_nodes; end - # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableTargetNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode # - # source://prism//lib/prism/node.rb#10339 - sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableTargetNode) } - def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#9063 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10324 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9048 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#10347 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#9071 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -18837,44 +17534,25 @@ class Prism::InstanceVariableTargetNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#10355 + # source://prism//lib/prism/node.rb#9079 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#10352 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#9076 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#10373 + # source://prism//lib/prism/node.rb#9084 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#10383 + # source://prism//lib/prism/node.rb#9089 def type; end end end @@ -18884,80 +17562,55 @@ end # @foo = 1 # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#10399 +# source://prism//lib/prism/node.rb#9105 class Prism::InstanceVariableWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # Initialize a new InstanceVariableWriteNode node. # # @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode # - # source://prism//lib/prism/node.rb#10401 - 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 + # source://prism//lib/prism/node.rb#9107 + def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); 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#10519 + # source://prism//lib/prism/node.rb#9209 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10411 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#9119 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10416 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9124 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10426 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#9134 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10421 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#9129 def compact_child_nodes; end - # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> InstanceVariableWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode # - # source://prism//lib/prism/node.rb#10431 - 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 + # source://prism//lib/prism/node.rb#9139 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10416 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9124 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#10439 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#9147 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -18965,7 +17618,7 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#10485 + # source://prism//lib/prism/node.rb#9193 sig { override.returns(String) } def inspect; end @@ -18975,8 +17628,7 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # # @_foo = "bar" # name `@_foo` # - # source://prism//lib/prism/node.rb#10448 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#9156 def name; end # The location of the variable name. @@ -18984,14 +17636,12 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # @_x = 1 # ^^^ # - # source://prism//lib/prism/node.rb#10454 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#9162 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#10480 - sig { returns(String) } + # source://prism//lib/prism/node.rb#9188 def operator; end # The location of the `=` operator. @@ -18999,26 +17649,12 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # @x = y # ^ # - # source://prism//lib/prism/node.rb#10473 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#9181 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#10503 + # source://prism//lib/prism/node.rb#9198 sig { override.returns(Symbol) } def type; end @@ -19030,46 +17666,40 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # @_x = 1234 # ^^^^ # - # source://prism//lib/prism/node.rb#10467 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#9175 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#10513 + # source://prism//lib/prism/node.rb#9203 def type; end end end # Flags for integer nodes that correspond to the base of the integer. # -# source://prism//lib/prism/node.rb#19166 +# source://prism//lib/prism/node.rb#16689 module Prism::IntegerBaseFlags; end # 0b prefix # -# source://prism//lib/prism/node.rb#19168 +# source://prism//lib/prism/node.rb#16691 Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) # 0d or no prefix # -# source://prism//lib/prism/node.rb#19171 +# source://prism//lib/prism/node.rb#16694 Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) # 0x prefix # -# source://prism//lib/prism/node.rb#19177 +# source://prism//lib/prism/node.rb#16700 Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) # 0o or 0 prefix # -# source://prism//lib/prism/node.rb#19174 +# source://prism//lib/prism/node.rb#16697 Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) # Represents an integer number literal. @@ -19077,25 +17707,33 @@ Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) # 1 # ^ # -# source://prism//lib/prism/node.rb#10532 +# source://prism//lib/prism/node.rb#9222 class Prism::IntegerNode < ::Prism::Node - # def initialize: (Integer flags, Integer value, Location location) -> void + # Initialize a new IntegerNode node. # # @return [IntegerNode] a new instance of IntegerNode # - # source://prism//lib/prism/node.rb#10534 - sig { params(source: Prism::Source, flags: Integer, value: Integer, location: Prism::Location).void } - def initialize(source, flags, value, location); end + # source://prism//lib/prism/node.rb#9224 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Integer + ).void + end + def initialize(source, node_id, location, flags, value); 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#10636 + # source://prism//lib/prism/node.rb#9305 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10542 + # source://prism//lib/prism/node.rb#9233 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -19103,52 +17741,59 @@ class Prism::IntegerNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10582 + # source://prism//lib/prism/node.rb#9266 sig { returns(T::Boolean) } def binary?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10547 + # source://prism//lib/prism/node.rb#9238 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#10557 + # source://prism//lib/prism/node.rb#9248 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#10552 + # source://prism//lib/prism/node.rb#9243 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (?flags: Integer, ?value: Integer, ?location: Location) -> IntegerNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode # - # source://prism//lib/prism/node.rb#10562 - 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 + # source://prism//lib/prism/node.rb#9253 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Integer + ).returns(Prism::IntegerNode) + end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end # def decimal?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10587 + # source://prism//lib/prism/node.rb#9271 sig { returns(T::Boolean) } def decimal?; end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10547 + # source://prism//lib/prism/node.rb#9238 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, value: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Integer } # - # source://prism//lib/prism/node.rb#10570 + # source://prism//lib/prism/node.rb#9261 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -19159,13 +17804,13 @@ class Prism::IntegerNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10597 + # source://prism//lib/prism/node.rb#9281 sig { returns(T::Boolean) } def hexadecimal?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#10602 + # source://prism//lib/prism/node.rb#9289 sig { override.returns(String) } def inspect; end @@ -19173,52 +17818,26 @@ class Prism::IntegerNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10592 + # source://prism//lib/prism/node.rb#9276 sig { returns(T::Boolean) } def octal?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#10620 + # source://prism//lib/prism/node.rb#9294 sig { override.returns(Symbol) } def type; end # The value of the integer literal as a number. # - # source://prism//lib/prism/node.rb#10579 + # source://prism//lib/prism/node.rb#9286 sig { returns(Integer) } def value; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#10575 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#10630 + # source://prism//lib/prism/node.rb#9299 def type; end end end @@ -19228,36 +17847,37 @@ end # if /foo #{bar} baz/ then end # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#10647 +# source://prism//lib/prism/node.rb#9316 class Prism::InterpolatedMatchLastLineNode < ::Prism::Node include ::Prism::RegularExpressionOptions - # def initialize: (Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void + # Initialize a new InterpolatedMatchLastLineNode node. # # @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode # - # source://prism//lib/prism/node.rb#10649 + # source://prism//lib/prism/node.rb#9318 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], - closing_loc: Prism::Location, - location: Prism::Location + closing_loc: Prism::Location ).void end - def initialize(source, flags, opening_loc, parts, closing_loc, location); end + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); 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#10812 + # source://prism//lib/prism/node.rb#9460 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10659 + # source://prism//lib/prism/node.rb#9329 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -19265,64 +17885,65 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10738 + # source://prism//lib/prism/node.rb#9387 sig { returns(T::Boolean) } def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10664 + # source://prism//lib/prism/node.rb#9334 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#10773 + # source://prism//lib/prism/node.rb#9439 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#10706 + # source://prism//lib/prism/node.rb#9427 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10674 + # source://prism//lib/prism/node.rb#9344 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#10669 + # source://prism//lib/prism/node.rb#9339 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode # - # source://prism//lib/prism/node.rb#10679 + # source://prism//lib/prism/node.rb#9349 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], - closing_loc: Prism::Location, - location: Prism::Location + closing_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10664 + # source://prism//lib/prism/node.rb#9334 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location } # - # source://prism//lib/prism/node.rb#10687 + # source://prism//lib/prism/node.rb#9357 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -19330,7 +17951,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10733 + # source://prism//lib/prism/node.rb#9382 sig { returns(T::Boolean) } def euc_jp?; end @@ -19338,7 +17959,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10718 + # source://prism//lib/prism/node.rb#9367 sig { returns(T::Boolean) } def extended?; end @@ -19349,7 +17970,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10758 + # source://prism//lib/prism/node.rb#9407 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -19357,7 +17978,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10763 + # source://prism//lib/prism/node.rb#9412 sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end @@ -19365,7 +17986,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10753 + # source://prism//lib/prism/node.rb#9402 sig { returns(T::Boolean) } def forced_utf8_encoding?; end @@ -19373,13 +17994,13 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10713 + # source://prism//lib/prism/node.rb#9362 sig { returns(T::Boolean) } def ignore_case?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#10778 + # source://prism//lib/prism/node.rb#9444 sig { override.returns(String) } def inspect; end @@ -19387,30 +18008,30 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10723 + # source://prism//lib/prism/node.rb#9372 sig { returns(T::Boolean) } def multi_line?; end # source://prism//lib/prism/parse_result/newlines.rb#121 - def newline!(lines); end + def newline_flag!(lines); end # def once?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10728 + # source://prism//lib/prism/node.rb#9377 sig { returns(T::Boolean) } def once?; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#10768 + # source://prism//lib/prism/node.rb#9434 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#10696 + # source://prism//lib/prism/node.rb#9417 sig { returns(Prism::Location) } def opening_loc; end @@ -19419,26 +18040,13 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism//lib/prism/node.rb#10703 + # source://prism//lib/prism/node.rb#9424 sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } def parts; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#10796 + # source://prism//lib/prism/node.rb#9449 sig { override.returns(Symbol) } def type; end @@ -19446,7 +18054,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10748 + # source://prism//lib/prism/node.rb#9397 sig { returns(T::Boolean) } def utf_8?; end @@ -19454,27 +18062,14 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10743 + # source://prism//lib/prism/node.rb#9392 sig { returns(T::Boolean) } def windows_31j?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#10692 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#10806 + # source://prism//lib/prism/node.rb#9454 def type; end end end @@ -19484,36 +18079,37 @@ end # /foo #{bar} baz/ # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#10826 +# source://prism//lib/prism/node.rb#9474 class Prism::InterpolatedRegularExpressionNode < ::Prism::Node include ::Prism::RegularExpressionOptions - # def initialize: (Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void + # Initialize a new InterpolatedRegularExpressionNode node. # # @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode # - # source://prism//lib/prism/node.rb#10828 + # source://prism//lib/prism/node.rb#9476 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], - closing_loc: Prism::Location, - location: Prism::Location + closing_loc: Prism::Location ).void end - def initialize(source, flags, opening_loc, parts, closing_loc, location); end + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); 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#10991 + # source://prism//lib/prism/node.rb#9618 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10838 + # source://prism//lib/prism/node.rb#9487 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -19521,64 +18117,65 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10917 + # source://prism//lib/prism/node.rb#9545 sig { returns(T::Boolean) } def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10843 + # source://prism//lib/prism/node.rb#9492 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#10952 + # source://prism//lib/prism/node.rb#9597 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#10885 + # source://prism//lib/prism/node.rb#9585 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10853 + # source://prism//lib/prism/node.rb#9502 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#10848 + # source://prism//lib/prism/node.rb#9497 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode # - # source://prism//lib/prism/node.rb#10858 + # source://prism//lib/prism/node.rb#9507 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], - closing_loc: Prism::Location, - location: Prism::Location + closing_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10843 + # source://prism//lib/prism/node.rb#9492 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location } # - # source://prism//lib/prism/node.rb#10866 + # source://prism//lib/prism/node.rb#9515 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -19586,7 +18183,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10912 + # source://prism//lib/prism/node.rb#9540 sig { returns(T::Boolean) } def euc_jp?; end @@ -19594,7 +18191,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10897 + # source://prism//lib/prism/node.rb#9525 sig { returns(T::Boolean) } def extended?; end @@ -19605,7 +18202,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10937 + # source://prism//lib/prism/node.rb#9565 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -19613,7 +18210,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10942 + # source://prism//lib/prism/node.rb#9570 sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end @@ -19621,7 +18218,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10932 + # source://prism//lib/prism/node.rb#9560 sig { returns(T::Boolean) } def forced_utf8_encoding?; end @@ -19629,13 +18226,13 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10892 + # source://prism//lib/prism/node.rb#9520 sig { returns(T::Boolean) } def ignore_case?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#10957 + # source://prism//lib/prism/node.rb#9602 sig { override.returns(String) } def inspect; end @@ -19643,30 +18240,30 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10902 + # source://prism//lib/prism/node.rb#9530 sig { returns(T::Boolean) } def multi_line?; end # source://prism//lib/prism/parse_result/newlines.rb#128 - def newline!(lines); end + def newline_flag!(lines); end # def once?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10907 + # source://prism//lib/prism/node.rb#9535 sig { returns(T::Boolean) } def once?; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#10947 + # source://prism//lib/prism/node.rb#9592 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#10875 + # source://prism//lib/prism/node.rb#9575 sig { returns(Prism::Location) } def opening_loc; end @@ -19675,26 +18272,13 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism//lib/prism/node.rb#10882 + # source://prism//lib/prism/node.rb#9582 sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } def parts; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#10975 + # source://prism//lib/prism/node.rb#9607 sig { override.returns(Symbol) } def type; end @@ -19702,7 +18286,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10927 + # source://prism//lib/prism/node.rb#9555 sig { returns(T::Boolean) } def utf_8?; end @@ -19710,27 +18294,14 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10922 + # source://prism//lib/prism/node.rb#9550 sig { returns(T::Boolean) } def windows_31j?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#10871 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#10985 + # source://prism//lib/prism/node.rb#9612 def type; end end end @@ -19740,93 +18311,95 @@ end # "foo #{bar} baz" # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11005 +# source://prism//lib/prism/node.rb#9632 class Prism::InterpolatedStringNode < ::Prism::Node include ::Prism::HeredocQuery - # def initialize: (Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode] parts, Location? closing_loc, Location location) -> void + # Initialize a new InterpolatedStringNode node. # # @return [InterpolatedStringNode] a new instance of InterpolatedStringNode # - # source://prism//lib/prism/node.rb#11007 + # source://prism//lib/prism/node.rb#9634 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, 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 + closing_loc: T.nilable(Prism::Location) ).void end - def initialize(source, flags, opening_loc, parts, closing_loc, location); end + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); 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#11137 + # source://prism//lib/prism/node.rb#9743 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11017 + # source://prism//lib/prism/node.rb#9645 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#11022 + # source://prism//lib/prism/node.rb#9650 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#11098 + # source://prism//lib/prism/node.rb#9722 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#11070 + # source://prism//lib/prism/node.rb#9704 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11032 + # source://prism//lib/prism/node.rb#9660 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#11027 + # source://prism//lib/prism/node.rb#9655 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], ?closing_loc: Location?) -> InterpolatedStringNode # - # source://prism//lib/prism/node.rb#11037 + # source://prism//lib/prism/node.rb#9665 sig do params( + node_id: Integer, + location: Prism::Location, 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 + closing_loc: T.nilable(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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11022 + # source://prism//lib/prism/node.rb#9650 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], closing_loc: Location? } # - # source://prism//lib/prism/node.rb#11045 + # source://prism//lib/prism/node.rb#9673 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -19837,7 +18410,7 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#11083 + # source://prism//lib/prism/node.rb#9678 sig { returns(T::Boolean) } def frozen?; end @@ -19846,7 +18419,7 @@ class Prism::InterpolatedStringNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#11103 + # source://prism//lib/prism/node.rb#9727 sig { override.returns(String) } def inspect; end @@ -19854,82 +18427,56 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#11088 + # source://prism//lib/prism/node.rb#9683 sig { returns(T::Boolean) } def mutable?; end # source://prism//lib/prism/parse_result/newlines.rb#135 - def newline!(lines); end + def newline_flag!(lines); end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#11093 + # source://prism//lib/prism/node.rb#9717 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#11054 + # source://prism//lib/prism/node.rb#9688 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode] # - # source://prism//lib/prism/node.rb#11067 + # source://prism//lib/prism/node.rb#9701 sig do returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)]) end def parts; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#11121 + # source://prism//lib/prism/node.rb#9732 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#11050 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#11131 + # source://prism//lib/prism/node.rb#9737 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#19181 +# source://prism//lib/prism/node.rb#16704 module Prism::InterpolatedStringNodeFlags; end -# source://prism//lib/prism/node.rb#19183 +# source://prism//lib/prism/node.rb#16706 Prism::InterpolatedStringNodeFlags::FROZEN = T.let(T.unsafe(nil), Integer) -# source://prism//lib/prism/node.rb#19186 +# source://prism//lib/prism/node.rb#16709 Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer) # Represents a symbol literal that contains interpolation. @@ -19937,90 +18484,65 @@ Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer) # :"foo #{bar} baz" # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11151 +# source://prism//lib/prism/node.rb#9757 class Prism::InterpolatedSymbolNode < ::Prism::Node - # def initialize: (Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location? closing_loc, Location location) -> void + # Initialize a new InterpolatedSymbolNode node. # # @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode # - # source://prism//lib/prism/node.rb#11153 - 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 + # source://prism//lib/prism/node.rb#9759 + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); 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#11268 + # source://prism//lib/prism/node.rb#9858 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11162 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#9770 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11167 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9775 def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#11229 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#9837 def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#11211 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#9819 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11177 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#9785 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11172 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#9780 def compact_child_nodes; end - # def copy: (?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedSymbolNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode # - # source://prism//lib/prism/node.rb#11182 - 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 + # source://prism//lib/prism/node.rb#9790 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11167 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9775 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location? } # - # source://prism//lib/prism/node.rb#11190 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#9798 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -20028,59 +18550,38 @@ class Prism::InterpolatedSymbolNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#11234 + # source://prism//lib/prism/node.rb#9842 sig { override.returns(String) } def inspect; end # source://prism//lib/prism/parse_result/newlines.rb#142 - def newline!(lines); end + def newline_flag!(lines); end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#11224 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#9832 def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#11195 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#9803 def opening_loc; end # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism//lib/prism/node.rb#11208 - sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + # source://prism//lib/prism/node.rb#9816 def parts; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#11252 + # source://prism//lib/prism/node.rb#9847 sig { override.returns(Symbol) } def type; end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + class << self + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#11262 + # source://prism//lib/prism/node.rb#9852 def type; end end end @@ -20090,92 +18591,67 @@ end # `foo #{bar} baz` # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11281 +# source://prism//lib/prism/node.rb#9871 class Prism::InterpolatedXStringNode < ::Prism::Node include ::Prism::HeredocQuery - # def initialize: (Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void + # Initialize a new InterpolatedXStringNode node. # # @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode # - # source://prism//lib/prism/node.rb#11283 - 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 + # source://prism//lib/prism/node.rb#9873 + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); 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#11386 + # source://prism//lib/prism/node.rb#9960 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11292 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#9884 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11297 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9889 def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#11347 - sig { returns(String) } + # source://prism//lib/prism/node.rb#9939 def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#11335 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#9927 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11307 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#9899 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11302 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#9894 def compact_child_nodes; end - # def copy: (?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedXStringNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode # - # source://prism//lib/prism/node.rb#11312 - 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 + # source://prism//lib/prism/node.rb#9904 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11297 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9889 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location } # - # source://prism//lib/prism/node.rb#11320 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#9912 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -20186,59 +18662,38 @@ class Prism::InterpolatedXStringNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#11352 + # source://prism//lib/prism/node.rb#9944 sig { override.returns(String) } def inspect; end # source://prism//lib/prism/parse_result/newlines.rb#149 - def newline!(lines); end + def newline_flag!(lines); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#11342 - sig { returns(String) } + # source://prism//lib/prism/node.rb#9934 def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#11325 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#9917 def opening_loc; end # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism//lib/prism/node.rb#11332 - sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + # source://prism//lib/prism/node.rb#9924 def parts; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#11370 + # source://prism//lib/prism/node.rb#9949 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#11380 + # source://prism//lib/prism/node.rb#9954 def type; end end end @@ -20248,63 +18703,55 @@ end # -> { it } # ^^ # -# source://prism//lib/prism/node.rb#11399 +# source://prism//lib/prism/node.rb#9973 class Prism::ItLocalVariableReadNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new ItLocalVariableReadNode node. # # @return [ItLocalVariableReadNode] a new instance of ItLocalVariableReadNode # - # source://prism//lib/prism/node.rb#11401 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#9975 + def initialize(source, node_id, location, flags); 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#11474 + # source://prism//lib/prism/node.rb#10032 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11407 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#9983 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11412 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9988 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11422 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#9998 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11417 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#9993 def compact_child_nodes; end - # def copy: (?location: Location) -> ItLocalVariableReadNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItLocalVariableReadNode # - # source://prism//lib/prism/node.rb#11427 - sig { params(location: Prism::Location).returns(Prism::ItLocalVariableReadNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#10003 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11412 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#9988 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#11435 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10011 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -20312,38 +18759,20 @@ class Prism::ItLocalVariableReadNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#11440 + # source://prism//lib/prism/node.rb#10016 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#11458 + # source://prism//lib/prism/node.rb#10021 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#11468 + # source://prism//lib/prism/node.rb#10026 def type; end end end @@ -20353,63 +18782,55 @@ end # -> { it + it } # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11483 +# source://prism//lib/prism/node.rb#10041 class Prism::ItParametersNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new ItParametersNode node. # # @return [ItParametersNode] a new instance of ItParametersNode # - # source://prism//lib/prism/node.rb#11485 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#10043 + def initialize(source, node_id, location, flags); 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#11558 + # source://prism//lib/prism/node.rb#10100 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11491 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#10051 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11496 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10056 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11506 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#10066 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11501 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#10061 def compact_child_nodes; end - # def copy: (?location: Location) -> ItParametersNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItParametersNode # - # source://prism//lib/prism/node.rb#11511 - sig { params(location: Prism::Location).returns(Prism::ItParametersNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#10071 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11496 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10056 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#11519 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10079 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -20417,38 +18838,20 @@ class Prism::ItParametersNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#11524 + # source://prism//lib/prism/node.rb#10084 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#11542 + # source://prism//lib/prism/node.rb#10089 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#11552 + # source://prism//lib/prism/node.rb#10094 def type; end end end @@ -20458,81 +18861,83 @@ end # foo(a: b) # ^^^^ # -# source://prism//lib/prism/node.rb#11567 +# source://prism//lib/prism/node.rb#10109 class Prism::KeywordHashNode < ::Prism::Node - # def initialize: (Integer flags, Array[AssocNode | AssocSplatNode] elements, Location location) -> void + # Initialize a new KeywordHashNode node. # # @return [KeywordHashNode] a new instance of KeywordHashNode # - # source://prism//lib/prism/node.rb#11569 + # source://prism//lib/prism/node.rb#10111 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, - elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], - location: Prism::Location + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)] ).void end - def initialize(source, flags, elements, location); end + def initialize(source, node_id, location, flags, elements); 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#11656 + # source://prism//lib/prism/node.rb#10177 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11577 + # source://prism//lib/prism/node.rb#10120 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#11582 + # source://prism//lib/prism/node.rb#10125 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#11592 + # source://prism//lib/prism/node.rb#10135 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#11587 + # source://prism//lib/prism/node.rb#10130 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode], ?location: Location) -> KeywordHashNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode # - # source://prism//lib/prism/node.rb#11597 + # source://prism//lib/prism/node.rb#10140 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, - elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], - location: Prism::Location + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)] ).returns(Prism::KeywordHashNode) end - def copy(flags: T.unsafe(nil), elements: T.unsafe(nil), location: T.unsafe(nil)); end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11582 + # source://prism//lib/prism/node.rb#10125 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, elements: Array[AssocNode | AssocSplatNode] } # - # source://prism//lib/prism/node.rb#11605 + # source://prism//lib/prism/node.rb#10148 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#11614 + # source://prism//lib/prism/node.rb#10158 sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) } def elements; end @@ -20541,7 +18946,7 @@ class Prism::KeywordHashNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#11622 + # source://prism//lib/prism/node.rb#10161 sig { override.returns(String) } def inspect; end @@ -20549,58 +18954,32 @@ class Prism::KeywordHashNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#11617 + # source://prism//lib/prism/node.rb#10153 sig { returns(T::Boolean) } def symbol_keys?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#11640 + # source://prism//lib/prism/node.rb#10166 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#11610 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#11650 + # source://prism//lib/prism/node.rb#10171 def type; end end end # Flags for keyword hash nodes. # -# source://prism//lib/prism/node.rb#19190 +# source://prism//lib/prism/node.rb#16713 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#19192 +# source://prism//lib/prism/node.rb#16715 Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer) # Represents a keyword rest parameter to a method, block, or lambda definition. @@ -20609,79 +18988,81 @@ Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer) # ^^^ # end # -# source://prism//lib/prism/node.rb#11669 +# source://prism//lib/prism/node.rb#10190 class Prism::KeywordRestParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void + # Initialize a new KeywordRestParameterNode node. # # @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode # - # source://prism//lib/prism/node.rb#11671 + # source://prism//lib/prism/node.rb#10192 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: Prism::Location ).void end - def initialize(source, flags, name, name_loc, operator_loc, location); end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc); 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#11785 + # source://prism//lib/prism/node.rb#10285 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11681 + # source://prism//lib/prism/node.rb#10203 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#11686 + # source://prism//lib/prism/node.rb#10208 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#11696 + # source://prism//lib/prism/node.rb#10218 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#11691 + # source://prism//lib/prism/node.rb#10213 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode # - # source://prism//lib/prism/node.rb#11701 + # source://prism//lib/prism/node.rb#10223 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11686 + # source://prism//lib/prism/node.rb#10208 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location } # - # source://prism//lib/prism/node.rb#11709 + # source://prism//lib/prism/node.rb#10231 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -20690,31 +19071,31 @@ class Prism::KeywordRestParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#11751 + # source://prism//lib/prism/node.rb#10269 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol? # - # source://prism//lib/prism/node.rb#11718 + # source://prism//lib/prism/node.rb#10241 sig { returns(T.nilable(Symbol)) } def name; end # attr_reader name_loc: Location? # - # source://prism//lib/prism/node.rb#11721 + # source://prism//lib/prism/node.rb#10244 sig { returns(T.nilable(Prism::Location)) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#11746 + # source://prism//lib/prism/node.rb#10264 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#11734 + # source://prism//lib/prism/node.rb#10257 sig { returns(Prism::Location) } def operator_loc; end @@ -20722,46 +19103,20 @@ class Prism::KeywordRestParameterNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#11741 + # source://prism//lib/prism/node.rb#10236 sig { returns(T::Boolean) } def repeated_parameter?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#11769 + # source://prism//lib/prism/node.rb#10274 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#11714 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#11779 + # source://prism//lib/prism/node.rb#10279 def type; end end end @@ -20771,102 +19126,70 @@ end # ->(value) { value * 2 } # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11798 +# source://prism//lib/prism/node.rb#10298 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 + # Initialize a new LambdaNode node. # # @return [LambdaNode] a new instance of LambdaNode # - # source://prism//lib/prism/node.rb#11800 - 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 + # source://prism//lib/prism/node.rb#10300 + def initialize(source, node_id, location, flags, locals, operator_loc, opening_loc, closing_loc, parameters, body); 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#11927 + # source://prism//lib/prism/node.rb#10411 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11812 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#10314 def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#11875 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#10377 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11817 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10319 def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#11888 - sig { returns(String) } + # source://prism//lib/prism/node.rb#10390 def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#11865 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10367 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11830 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#10332 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11822 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#10324 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: Prism::node?, ?body: Prism::node?) -> LambdaNode # - # source://prism//lib/prism/node.rb#11835 - 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 + # source://prism//lib/prism/node.rb#10337 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11817 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10319 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: Prism::node?, body: Prism::node? } # - # source://prism//lib/prism/node.rb#11843 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10345 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -20874,74 +19197,50 @@ class Prism::LambdaNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#11893 + # source://prism//lib/prism/node.rb#10395 sig { override.returns(String) } def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#11848 - sig { returns(T::Array[Symbol]) } + # source://prism//lib/prism/node.rb#10350 def locals; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#11883 - sig { returns(String) } + # source://prism//lib/prism/node.rb#10385 def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#11858 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10360 def opening_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#11878 - sig { returns(String) } + # source://prism//lib/prism/node.rb#10380 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#11851 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10353 def operator_loc; end # attr_reader parameters: Prism::node? # - # source://prism//lib/prism/node.rb#11872 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#10374 def parameters; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#11911 + # source://prism//lib/prism/node.rb#10400 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#11921 + # source://prism//lib/prism/node.rb#10405 def type; end end end @@ -21197,13 +19496,13 @@ end # This is a result specific to the `lex` and `lex_file` methods. # -# source://prism//lib/prism/parse_result.rb#610 +# source://prism//lib/prism/parse_result.rb#627 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#615 + # source://prism//lib/prism/parse_result.rb#632 sig do params( value: T::Array[T.untyped], @@ -21219,13 +19518,13 @@ class Prism::LexResult < ::Prism::Result # Implement the hash pattern matching interface for LexResult. # - # source://prism//lib/prism/parse_result.rb#621 + # source://prism//lib/prism/parse_result.rb#638 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#612 + # source://prism//lib/prism/parse_result.rb#629 sig { returns(T::Array[T.untyped]) } def value; end end @@ -21257,91 +19556,63 @@ end # target &&= value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11943 +# source://prism//lib/prism/node.rb#10427 class Prism::LocalVariableAndWriteNode < ::Prism::Node - # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void + # Initialize a new LocalVariableAndWriteNode node. # # @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode # - # source://prism//lib/prism/node.rb#11945 - 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 + # source://prism//lib/prism/node.rb#10429 + def initialize(source, node_id, location, flags, name_loc, operator_loc, value, name, depth); 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#12051 + # source://prism//lib/prism/node.rb#10519 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11956 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#10442 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11961 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10447 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11971 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#10457 def comment_targets; end # def compact_child_nodes: () -> Array[Node] - # - # source://prism//lib/prism/node.rb#11966 - 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#11976 - 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 + # + # source://prism//lib/prism/node.rb#10452 + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#10462 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11961 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10447 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer } # - # source://prism//lib/prism/node.rb#11984 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10470 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://prism//lib/prism/node.rb#12009 - sig { returns(Integer) } + # source://prism//lib/prism/node.rb#10495 def depth; end - # source://prism//lib/prism/desugar_compiler.rb#199 + # source://prism//lib/prism/desugar_compiler.rb#236 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -21349,68 +19620,45 @@ class Prism::LocalVariableAndWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#12017 + # source://prism//lib/prism/node.rb#10503 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#12006 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#10492 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#11989 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10475 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#12012 - sig { returns(String) } + # source://prism//lib/prism/node.rb#10498 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#11996 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10482 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#12035 + # source://prism//lib/prism/node.rb#10508 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#12003 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#10489 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#12045 + # source://prism//lib/prism/node.rb#10513 def type; end end end @@ -21420,105 +19668,73 @@ end # target += value # ^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#12065 +# source://prism//lib/prism/node.rb#10533 class Prism::LocalVariableOperatorWriteNode < ::Prism::Node - # def initialize: (Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth, Location location) -> void + # Initialize a new LocalVariableOperatorWriteNode node. # # @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#12067 - sig do - params( - source: Prism::Source, - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - name: Symbol, - binary_operator: Symbol, - depth: Integer, - location: Prism::Location - ).void - end - def initialize(source, name_loc, binary_operator_loc, value, name, binary_operator, depth, location); end + # source://prism//lib/prism/node.rb#10535 + def initialize(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth); 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#12172 + # source://prism//lib/prism/node.rb#10624 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12079 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#10549 def accept(visitor); end # attr_reader binary_operator: Symbol # - # source://prism//lib/prism/node.rb#12132 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#10602 def binary_operator; end # attr_reader binary_operator_loc: Location # - # source://prism//lib/prism/node.rb#12119 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10589 def binary_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12084 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10554 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12094 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#10564 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12089 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#10559 def compact_child_nodes; end - # def copy: (?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#12099 - sig do - params( - name_loc: Prism::Location, - binary_operator_loc: Prism::Location, - value: Prism::Node, - name: Symbol, - binary_operator: Symbol, - depth: Integer, - location: Prism::Location - ).returns(Prism::LocalVariableOperatorWriteNode) - end - def copy(name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#10569 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12084 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10554 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer } # - # source://prism//lib/prism/node.rb#12107 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10577 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://prism//lib/prism/node.rb#12135 - sig { returns(Integer) } + # source://prism//lib/prism/node.rb#10605 def depth; end - # source://prism//lib/prism/desugar_compiler.rb#211 + # source://prism//lib/prism/desugar_compiler.rb#248 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -21526,68 +19742,47 @@ class Prism::LocalVariableOperatorWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#12138 + # source://prism//lib/prism/node.rb#10608 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#12129 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#10599 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#12112 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10582 def name_loc; end # Returns the binary operator used to modify the receiver. This method is # deprecated in favor of #binary_operator. # - # source://prism//lib/prism/node_ext.rb#435 + # source://prism//lib/prism/node_ext.rb#451 def operator; end # Returns the location of the binary operator used to modify the receiver. # This method is deprecated in favor of #binary_operator_loc. # - # source://prism//lib/prism/node_ext.rb#442 + # source://prism//lib/prism/node_ext.rb#458 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#12156 + # source://prism//lib/prism/node.rb#10613 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#12126 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#10596 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#12166 + # source://prism//lib/prism/node.rb#10618 def type; end end end @@ -21597,91 +19792,63 @@ end # target ||= value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#12187 +# source://prism//lib/prism/node.rb#10639 class Prism::LocalVariableOrWriteNode < ::Prism::Node - # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void + # Initialize a new LocalVariableOrWriteNode node. # # @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode # - # source://prism//lib/prism/node.rb#12189 - 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 + # source://prism//lib/prism/node.rb#10641 + def initialize(source, node_id, location, flags, name_loc, operator_loc, value, name, depth); 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#12295 + # source://prism//lib/prism/node.rb#10731 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12200 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#10654 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12205 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10659 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12215 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#10669 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12210 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#10664 def compact_child_nodes; end - # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOrWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode # - # source://prism//lib/prism/node.rb#12220 - 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 + # source://prism//lib/prism/node.rb#10674 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12205 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10659 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer } # - # source://prism//lib/prism/node.rb#12228 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10682 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://prism//lib/prism/node.rb#12253 - sig { returns(Integer) } + # source://prism//lib/prism/node.rb#10707 def depth; end - # source://prism//lib/prism/desugar_compiler.rb#205 + # source://prism//lib/prism/desugar_compiler.rb#242 def desugar; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -21689,68 +19856,45 @@ class Prism::LocalVariableOrWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#12261 + # source://prism//lib/prism/node.rb#10715 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#12250 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#10704 def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#12233 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10687 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#12256 - sig { returns(String) } + # source://prism//lib/prism/node.rb#10710 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#12240 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10694 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#12279 + # source://prism//lib/prism/node.rb#10720 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#12247 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#10701 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#12289 + # source://prism//lib/prism/node.rb#10725 def type; end end end @@ -21760,63 +19904,55 @@ end # foo # ^^^ # -# source://prism//lib/prism/node.rb#12309 +# source://prism//lib/prism/node.rb#10745 class Prism::LocalVariableReadNode < ::Prism::Node - # def initialize: (Symbol name, Integer depth, Location location) -> void + # Initialize a new LocalVariableReadNode node. # # @return [LocalVariableReadNode] a new instance of LocalVariableReadNode # - # source://prism//lib/prism/node.rb#12311 - sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void } - def initialize(source, name, depth, location); end + # source://prism//lib/prism/node.rb#10747 + def initialize(source, node_id, location, flags, name, depth); 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#12406 + # source://prism//lib/prism/node.rb#10826 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12319 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#10757 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12324 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10762 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12334 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#10772 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12329 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#10767 def compact_child_nodes; end - # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableReadNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode # - # source://prism//lib/prism/node.rb#12339 - 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 + # source://prism//lib/prism/node.rb#10777 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12324 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10762 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer } # - # source://prism//lib/prism/node.rb#12347 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10785 def deconstruct_keys(keys); end # The number of visible scopes that should be searched to find the origin of this local variable. @@ -21827,8 +19963,7 @@ 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#12369 - sig { returns(Integer) } + # source://prism//lib/prism/node.rb#10807 def depth; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -21836,7 +19971,7 @@ class Prism::LocalVariableReadNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#12372 + # source://prism//lib/prism/node.rb#10810 sig { override.returns(String) } def inspect; end @@ -21850,38 +19985,19 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # _1 # name `:_1` # - # source://prism//lib/prism/node.rb#12360 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#10798 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#12390 + # source://prism//lib/prism/node.rb#10815 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#12400 + # source://prism//lib/prism/node.rb#10820 def type; end end end @@ -21891,69 +20007,60 @@ end # foo, bar = baz # ^^^ ^^^ # -# source://prism//lib/prism/node.rb#12417 +# source://prism//lib/prism/node.rb#10837 class Prism::LocalVariableTargetNode < ::Prism::Node - # def initialize: (Symbol name, Integer depth, Location location) -> void + # Initialize a new LocalVariableTargetNode node. # # @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode # - # source://prism//lib/prism/node.rb#12419 - sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void } - def initialize(source, name, depth, location); end + # source://prism//lib/prism/node.rb#10839 + def initialize(source, node_id, location, flags, name, depth); 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#12500 + # source://prism//lib/prism/node.rb#10904 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12427 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#10849 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12432 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10854 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12442 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#10864 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12437 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#10859 def compact_child_nodes; end - # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableTargetNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode # - # source://prism//lib/prism/node.rb#12447 - 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 + # source://prism//lib/prism/node.rb#10869 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12432 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10854 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer } # - # source://prism//lib/prism/node.rb#12455 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10877 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://prism//lib/prism/node.rb#12463 - sig { returns(Integer) } + # source://prism//lib/prism/node.rb#10885 def depth; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -21961,44 +20068,25 @@ class Prism::LocalVariableTargetNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#12466 + # source://prism//lib/prism/node.rb#10888 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#12460 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#10882 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#12484 + # source://prism//lib/prism/node.rb#10893 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#12494 + # source://prism//lib/prism/node.rb#10898 def type; end end end @@ -22008,82 +20096,55 @@ end # foo = 1 # ^^^^^^^ # -# source://prism//lib/prism/node.rb#12511 +# source://prism//lib/prism/node.rb#10915 class Prism::LocalVariableWriteNode < ::Prism::Node - # def initialize: (Symbol name, Integer depth, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # Initialize a new LocalVariableWriteNode node. # # @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode # - # source://prism//lib/prism/node.rb#12513 - 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 + # source://prism//lib/prism/node.rb#10917 + def initialize(source, node_id, location, flags, name, depth, name_loc, value, operator_loc); 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#12645 + # source://prism//lib/prism/node.rb#11033 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12524 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#10930 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12529 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10935 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12539 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#10945 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12534 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#10940 def compact_child_nodes; end - # def copy: (?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> LocalVariableWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode # - # source://prism//lib/prism/node.rb#12544 - 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 + # source://prism//lib/prism/node.rb#10950 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12529 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#10935 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#12552 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#10958 def deconstruct_keys(keys); end # The number of semantic scopes we have to traverse to find the declaration of this variable. @@ -22094,8 +20155,7 @@ class Prism::LocalVariableWriteNode < ::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#12570 - sig { returns(Integer) } + # source://prism//lib/prism/node.rb#10976 def depth; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -22103,7 +20163,7 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#12611 + # source://prism//lib/prism/node.rb#11017 sig { override.returns(String) } def inspect; end @@ -22113,8 +20173,7 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # # abc = 123 # name `:abc` # - # source://prism//lib/prism/node.rb#12561 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#10967 def name; end # The location of the variable name. @@ -22122,41 +20181,25 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # foo = :bar # ^^^ # - # source://prism//lib/prism/node.rb#12576 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#10982 def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#12606 - sig { returns(String) } + # source://prism//lib/prism/node.rb#11012 def operator; end # The location of the `=` operator. # - # x = :y - # ^ - # - # source://prism//lib/prism/node.rb#12599 - sig { returns(Prism::Location) } - def operator_loc; end - - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # x = :y + # ^ # - # def type: () -> Symbol + # source://prism//lib/prism/node.rb#11005 + def operator_loc; end + + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#12629 + # source://prism//lib/prism/node.rb#11022 sig { override.returns(Symbol) } def type; end @@ -22172,39 +20215,33 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # # foo = foo # - # source://prism//lib/prism/node.rb#12593 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#10999 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#12639 + # source://prism//lib/prism/node.rb#11027 def type; end end end # This represents a location in the source. # -# source://prism//lib/prism/parse_result.rb#156 +# source://prism//lib/prism/parse_result.rb#165 class Prism::Location # Create a new location object with the given source, start byte offset, and # byte length. # # @return [Location] a new instance of Location # - # source://prism//lib/prism/parse_result.rb#171 + # source://prism//lib/prism/parse_result.rb#180 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#335 + # source://prism//lib/prism/parse_result.rb#344 sig { params(other: T.untyped).returns(T::Boolean) } def ==(other); end @@ -22212,84 +20249,84 @@ class Prism::Location # that occurs after this location on the same line, and return the new # location. This will raise an error if the string does not exist. # - # source://prism//lib/prism/parse_result.rb#354 + # source://prism//lib/prism/parse_result.rb#363 sig { params(string: String).returns(Prism::Location) } def adjoin(string); end # Returns a new location that is the result of chopping off the last byte. # - # source://prism//lib/prism/parse_result.rb#217 + # source://prism//lib/prism/parse_result.rb#226 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#207 + # source://prism//lib/prism/parse_result.rb#216 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#212 + # source://prism//lib/prism/parse_result.rb#221 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#325 + # source://prism//lib/prism/parse_result.rb#334 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#314 + # source://prism//lib/prism/parse_result.rb#323 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#263 + # source://prism//lib/prism/parse_result.rb#272 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#320 + # source://prism//lib/prism/parse_result.rb#329 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#268 + # source://prism//lib/prism/parse_result.rb#277 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#308 + # source://prism//lib/prism/parse_result.rb#317 sig { returns(Integer) } def end_column; end # The line number where this location ends. # - # source://prism//lib/prism/parse_result.rb#284 + # source://prism//lib/prism/parse_result.rb#293 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#257 + # source://prism//lib/prism/parse_result.rb#266 sig { returns(Integer) } def end_offset; end # Returns a string representation of this location. # - # source://prism//lib/prism/parse_result.rb#222 + # source://prism//lib/prism/parse_result.rb#231 sig { returns(String) } def inspect; end @@ -22297,38 +20334,38 @@ class Prism::Location # 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#344 + # source://prism//lib/prism/parse_result.rb#353 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#190 + # source://prism//lib/prism/parse_result.rb#199 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#185 + # source://prism//lib/prism/parse_result.rb#194 sig { returns(T::Array[Prism::Comment]) } def leading_comments; end # The length of this location in bytes. # - # source://prism//lib/prism/parse_result.rb#167 + # source://prism//lib/prism/parse_result.rb#176 sig { returns(Integer) } def length; end # Implement the pretty print interface for Location. # - # source://prism//lib/prism/parse_result.rb#330 + # source://prism//lib/prism/parse_result.rb#339 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#232 + # source://prism//lib/prism/parse_result.rb#241 sig { returns(String) } def slice; end @@ -22336,78 +20373,78 @@ class Prism::Location # of the line that this location starts on to the end of the line that this # location ends on. # - # source://prism//lib/prism/parse_result.rb#239 + # source://prism//lib/prism/parse_result.rb#248 def slice_lines; end # Returns all of the lines of the source code associated with this location. # - # source://prism//lib/prism/parse_result.rb#227 + # source://prism//lib/prism/parse_result.rb#236 sig { returns(T::Array[String]) } def source_lines; end # The column number in characters where this location ends from the start of # the line. # - # source://prism//lib/prism/parse_result.rb#296 + # source://prism//lib/prism/parse_result.rb#305 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#247 + # source://prism//lib/prism/parse_result.rb#256 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#302 + # source://prism//lib/prism/parse_result.rb#311 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#252 + # source://prism//lib/prism/parse_result.rb#261 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#290 + # source://prism//lib/prism/parse_result.rb#299 sig { returns(Integer) } def start_column; end # The line number where this location starts. # - # source://prism//lib/prism/parse_result.rb#273 + # source://prism//lib/prism/parse_result.rb#282 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#278 + # source://prism//lib/prism/parse_result.rb#287 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#164 + # source://prism//lib/prism/parse_result.rb#173 sig { returns(Integer) } def start_offset; end # Attach a comment to the trailing comments of this location. # - # source://prism//lib/prism/parse_result.rb#201 + # source://prism//lib/prism/parse_result.rb#210 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#196 + # source://prism//lib/prism/parse_result.rb#205 sig { returns(T::Array[Prism::Comment]) } def trailing_comments; end @@ -22416,66 +20453,66 @@ class Prism::Location # A Source object that is used to determine more information from the given # offset and length. # - # source://prism//lib/prism/parse_result.rb#159 + # source://prism//lib/prism/parse_result.rb#168 sig { returns(Prism::Source) } def source; end end # Flags for while and until loop nodes. # -# source://prism//lib/prism/node.rb#19196 +# source://prism//lib/prism/node.rb#16719 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#19198 +# source://prism//lib/prism/node.rb#16721 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#416 +# source://prism//lib/prism/parse_result.rb#425 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#424 + # source://prism//lib/prism/parse_result.rb#433 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#440 + # source://prism//lib/prism/parse_result.rb#449 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#445 + # source://prism//lib/prism/parse_result.rb#454 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#430 + # source://prism//lib/prism/parse_result.rb#439 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#418 + # source://prism//lib/prism/parse_result.rb#427 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#435 + # source://prism//lib/prism/parse_result.rb#444 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#421 + # source://prism//lib/prism/parse_result.rb#430 sig { returns(Prism::Location) } def value_loc; end end @@ -22485,37 +20522,38 @@ end # if /foo/i then end # ^^^^^^ # -# source://prism//lib/prism/node.rb#12659 +# source://prism//lib/prism/node.rb#11047 class Prism::MatchLastLineNode < ::Prism::Node include ::Prism::RegularExpressionOptions - # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void + # Initialize a new MatchLastLineNode node. # # @return [MatchLastLineNode] a new instance of MatchLastLineNode # - # source://prism//lib/prism/node.rb#12661 + # source://prism//lib/prism/node.rb#11049 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, content_loc: Prism::Location, closing_loc: Prism::Location, - unescaped: String, - location: Prism::Location + unescaped: String ).void end - def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); 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#12837 + # source://prism//lib/prism/node.rb#11204 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12672 + # source://prism//lib/prism/node.rb#11061 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -22523,77 +20561,78 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12758 + # source://prism//lib/prism/node.rb#11119 sig { returns(T::Boolean) } def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12677 + # source://prism//lib/prism/node.rb#11066 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#12798 + # source://prism//lib/prism/node.rb#11183 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#12723 + # source://prism//lib/prism/node.rb#11163 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12687 + # source://prism//lib/prism/node.rb#11076 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#12682 + # source://prism//lib/prism/node.rb#11071 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism//lib/prism/node.rb#12793 + # source://prism//lib/prism/node.rb#11178 sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//lib/prism/node.rb#12716 + # source://prism//lib/prism/node.rb#11156 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode # - # source://prism//lib/prism/node.rb#12692 + # source://prism//lib/prism/node.rb#11081 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, content_loc: Prism::Location, closing_loc: Prism::Location, - unescaped: String, - location: Prism::Location + unescaped: String ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12677 + # source://prism//lib/prism/node.rb#11066 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String } # - # source://prism//lib/prism/node.rb#12700 + # source://prism//lib/prism/node.rb#11089 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -22601,7 +20640,7 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12753 + # source://prism//lib/prism/node.rb#11114 sig { returns(T::Boolean) } def euc_jp?; end @@ -22609,7 +20648,7 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12738 + # source://prism//lib/prism/node.rb#11099 sig { returns(T::Boolean) } def extended?; end @@ -22620,7 +20659,7 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12778 + # source://prism//lib/prism/node.rb#11139 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -22628,7 +20667,7 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12783 + # source://prism//lib/prism/node.rb#11144 sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end @@ -22636,7 +20675,7 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12773 + # source://prism//lib/prism/node.rb#11134 sig { returns(T::Boolean) } def forced_utf8_encoding?; end @@ -22644,13 +20683,13 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12733 + # source://prism//lib/prism/node.rb#11094 sig { returns(T::Boolean) } def ignore_case?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#12803 + # source://prism//lib/prism/node.rb#11188 sig { override.returns(String) } def inspect; end @@ -22658,7 +20697,7 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12743 + # source://prism//lib/prism/node.rb#11104 sig { returns(T::Boolean) } def multi_line?; end @@ -22666,47 +20705,34 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12748 + # source://prism//lib/prism/node.rb#11109 sig { returns(T::Boolean) } def once?; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#12788 + # source://prism//lib/prism/node.rb#11173 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#12709 + # source://prism//lib/prism/node.rb#11149 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 - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#12821 + # source://prism//lib/prism/node.rb#11193 sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#12730 + # source://prism//lib/prism/node.rb#11170 sig { returns(String) } def unescaped; end @@ -22714,7 +20740,7 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12768 + # source://prism//lib/prism/node.rb#11129 sig { returns(T::Boolean) } def utf_8?; end @@ -22722,27 +20748,14 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12763 + # source://prism//lib/prism/node.rb#11124 sig { returns(T::Boolean) } def windows_31j?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#12705 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#12831 + # source://prism//lib/prism/node.rb#11198 def type; end end end @@ -22752,78 +20765,55 @@ end # foo in bar # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#12851 +# source://prism//lib/prism/node.rb#11218 class Prism::MatchPredicateNode < ::Prism::Node - # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void + # Initialize a new MatchPredicateNode node. # # @return [MatchPredicateNode] a new instance of MatchPredicateNode # - # source://prism//lib/prism/node.rb#12853 - 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 + # source://prism//lib/prism/node.rb#11220 + def initialize(source, node_id, location, flags, value, pattern, operator_loc); 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#12947 + # source://prism//lib/prism/node.rb#11298 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12862 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#11231 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12867 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11236 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12877 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#11246 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12872 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#11241 def compact_child_nodes; end - # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchPredicateNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchPredicateNode # - # source://prism//lib/prism/node.rb#12882 - 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 + # source://prism//lib/prism/node.rb#11251 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12867 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11236 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, pattern: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#12890 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#11259 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -22831,62 +20821,40 @@ class Prism::MatchPredicateNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#12913 + # source://prism//lib/prism/node.rb#11282 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#12908 - sig { returns(String) } + # source://prism//lib/prism/node.rb#11277 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#12901 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#11270 def operator_loc; end # attr_reader pattern: Prism::node # - # source://prism//lib/prism/node.rb#12898 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#11267 def pattern; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#12931 + # source://prism//lib/prism/node.rb#11287 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#12895 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#11264 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#12941 + # source://prism//lib/prism/node.rb#11292 def type; end end end @@ -22896,78 +20864,55 @@ end # foo => bar # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#12959 +# source://prism//lib/prism/node.rb#11310 class Prism::MatchRequiredNode < ::Prism::Node - # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void + # Initialize a new MatchRequiredNode node. # # @return [MatchRequiredNode] a new instance of MatchRequiredNode # - # source://prism//lib/prism/node.rb#12961 - 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 + # source://prism//lib/prism/node.rb#11312 + def initialize(source, node_id, location, flags, value, pattern, operator_loc); 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#13055 + # source://prism//lib/prism/node.rb#11390 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12970 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#11323 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12975 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11328 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12985 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#11338 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12980 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#11333 def compact_child_nodes; end - # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchRequiredNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode # - # source://prism//lib/prism/node.rb#12990 - 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 + # source://prism//lib/prism/node.rb#11343 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12975 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11328 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, pattern: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#12998 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#11351 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -22975,62 +20920,40 @@ class Prism::MatchRequiredNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13021 + # source://prism//lib/prism/node.rb#11374 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#13016 - sig { returns(String) } + # source://prism//lib/prism/node.rb#11369 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#13009 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#11362 def operator_loc; end # attr_reader pattern: Prism::node # - # source://prism//lib/prism/node.rb#13006 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#11359 def pattern; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#13039 + # source://prism//lib/prism/node.rb#11379 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#13003 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#11356 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#13049 + # source://prism//lib/prism/node.rb#11384 def type; end end end @@ -23040,82 +20963,60 @@ end # /(?bar)/ =~ baz # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#13067 +# source://prism//lib/prism/node.rb#11402 class Prism::MatchWriteNode < ::Prism::Node - # def initialize: (CallNode call, Array[LocalVariableTargetNode] targets, Location location) -> void + # Initialize a new MatchWriteNode node. # # @return [MatchWriteNode] a new instance of MatchWriteNode # - # source://prism//lib/prism/node.rb#13069 - 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 + # source://prism//lib/prism/node.rb#11404 + def initialize(source, node_id, location, flags, call, targets); 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#13150 + # source://prism//lib/prism/node.rb#11469 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13077 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#11414 def accept(visitor); end # attr_reader call: CallNode # - # source://prism//lib/prism/node.rb#13110 - sig { returns(Prism::CallNode) } + # source://prism//lib/prism/node.rb#11447 def call; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13082 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11419 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13092 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#11429 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13087 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#11424 def compact_child_nodes; end - # def copy: (?call: CallNode, ?targets: Array[LocalVariableTargetNode], ?location: Location) -> MatchWriteNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode # - # source://prism//lib/prism/node.rb#13097 - 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 + # source://prism//lib/prism/node.rb#11434 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), call: T.unsafe(nil), targets: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13082 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11419 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { call: CallNode, targets: Array[LocalVariableTargetNode], location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, call: CallNode, targets: Array[LocalVariableTargetNode] } # - # source://prism//lib/prism/node.rb#13105 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#11442 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -23123,107 +21024,80 @@ class Prism::MatchWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13116 + # source://prism//lib/prism/node.rb#11453 sig { override.returns(String) } def inspect; end # attr_reader targets: Array[LocalVariableTargetNode] # - # source://prism//lib/prism/node.rb#13113 - sig { returns(T::Array[Prism::LocalVariableTargetNode]) } + # source://prism//lib/prism/node.rb#11450 def targets; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#13134 + # source://prism//lib/prism/node.rb#11458 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#13144 + # source://prism//lib/prism/node.rb#11463 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#13159 +# source://prism//lib/prism/node.rb#11478 class Prism::MissingNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new MissingNode node. # # @return [MissingNode] a new instance of MissingNode # - # source://prism//lib/prism/node.rb#13161 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#11480 + def initialize(source, node_id, location, flags); 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#13234 + # source://prism//lib/prism/node.rb#11537 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13167 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#11488 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13172 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11493 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13182 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#11503 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13177 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#11498 def compact_child_nodes; end - # def copy: (?location: Location) -> MissingNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> MissingNode # - # source://prism//lib/prism/node.rb#13187 - sig { params(location: Prism::Location).returns(Prism::MissingNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#11508 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13172 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11493 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#13195 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#11516 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -23231,38 +21105,20 @@ class Prism::MissingNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13200 + # source://prism//lib/prism/node.rb#11521 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#13218 + # source://prism//lib/prism/node.rb#11526 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#13228 + # source://prism//lib/prism/node.rb#11531 def type; end end end @@ -23272,108 +21128,75 @@ end # module Foo end # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#13243 +# source://prism//lib/prism/node.rb#11546 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 + # Initialize a new ModuleNode node. # # @return [ModuleNode] a new instance of ModuleNode # - # source://prism//lib/prism/node.rb#13245 - 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 + # source://prism//lib/prism/node.rb#11548 + def initialize(source, node_id, location, flags, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name); 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#13363 + # source://prism//lib/prism/node.rb#11650 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13257 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#11562 def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#13306 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#11611 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13262 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11567 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13275 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#11580 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13267 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#11572 def compact_child_nodes; end # attr_reader constant_path: Prism::node # - # source://prism//lib/prism/node.rb#13303 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#11608 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: Prism::node, ?body: Prism::node?, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode # - # source://prism//lib/prism/node.rb#13280 - 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 + # source://prism//lib/prism/node.rb#11585 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), module_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13262 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11567 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], module_keyword_loc: Location, constant_path: Prism::node, body: Prism::node?, end_keyword_loc: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#13288 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#11593 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#13324 - sig { returns(String) } + # source://prism//lib/prism/node.rb#11629 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#13309 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#11614 def end_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -23381,62 +21204,40 @@ class Prism::ModuleNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13329 + # source://prism//lib/prism/node.rb#11634 sig { override.returns(String) } def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#13293 - sig { returns(T::Array[Symbol]) } + # source://prism//lib/prism/node.rb#11598 def locals; end # def module_keyword: () -> String # - # source://prism//lib/prism/node.rb#13319 - sig { returns(String) } + # source://prism//lib/prism/node.rb#11624 def module_keyword; end # attr_reader module_keyword_loc: Location # - # source://prism//lib/prism/node.rb#13296 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#11601 def module_keyword_loc; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#13316 - sig { returns(Symbol) } + # source://prism//lib/prism/node.rb#11621 def name; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#13347 + # source://prism//lib/prism/node.rb#11639 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#13357 + # source://prism//lib/prism/node.rb#11644 def type; end end end @@ -23446,82 +21247,60 @@ end # a, (b, c) = 1, 2, 3 # ^^^^^^ # -# source://prism//lib/prism/node.rb#13379 +# This can be a part of `MultiWriteNode` as above, or the target of a `for` loop +# +# for a, b in [[1, 2], [3, 4]] +# ^^^^ +# +# source://prism//lib/prism/node.rb#11671 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 + # Initialize a new MultiTargetNode node. # # @return [MultiTargetNode] a new instance of MultiTargetNode # - # source://prism//lib/prism/node.rb#13381 - 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 + # source://prism//lib/prism/node.rb#11673 + def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc); 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#13508 + # source://prism//lib/prism/node.rb#11814 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13392 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#11686 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13397 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11691 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13411 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#11705 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13402 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#11696 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: ImplicitRestNode | SplatNode | nil, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode # - # source://prism//lib/prism/node.rb#13416 - 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 + # source://prism//lib/prism/node.rb#11710 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13397 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11691 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], rest: ImplicitRestNode | SplatNode | nil, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode], lparen_loc: Location?, rparen_loc: Location? } # - # source://prism//lib/prism/node.rb#13424 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#11718 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -23529,84 +21308,85 @@ class Prism::MultiTargetNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13474 + # source://prism//lib/prism/node.rb#11798 sig { override.returns(String) } def inspect; end - # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] + # Represents the targets expressions before a splat node. # - # source://prism//lib/prism/node.rb#13429 - 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 + # a, (b, c, *) = 1, 2, 3, 4, 5 + # ^^^^ + # + # The splat node can be absent, in that case all target expressions are in the left field. + # + # a, (b, c) = 1, 2, 3, 4, 5 + # ^^^^ + # + # source://prism//lib/prism/node.rb#11731 def lefts; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#13464 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#11788 def lparen; end - # attr_reader lparen_loc: Location? + # The location of the opening parenthesis. # - # source://prism//lib/prism/node.rb#13438 - sig { returns(T.nilable(Prism::Location)) } + # a, (b, c) = 1, 2, 3 + # ^ + # + # source://prism//lib/prism/node.rb#11759 def lparen_loc; end - # attr_reader rest: Prism::node? + # Represents a splat node in the target expression. # - # source://prism//lib/prism/node.rb#13432 - sig { returns(T.nilable(Prism::Node)) } + # a, (b, *c) = 1, 2, 3, 4 + # ^^ + # + # The variable can be empty, this results in a `SplatNode` with a `nil` expression field. + # + # a, (b, *) = 1, 2, 3, 4 + # ^ + # + # If the `*` is omitted, the field will containt an `ImplicitRestNode` + # + # a, (b,) = 1, 2, 3, 4 + # ^ + # + # source://prism//lib/prism/node.rb#11747 def rest; end - # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode] + # Represents the targets expressions after a splat node. # - # source://prism//lib/prism/node.rb#13435 - 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 + # a, (*, b, c) = 1, 2, 3, 4, 5 + # ^^^^ + # + # source://prism//lib/prism/node.rb#11753 def rights; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#13469 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#11793 def rparen; end - # attr_reader rparen_loc: Location? + # The location of the closing parenthesis. # - # source://prism//lib/prism/node.rb#13451 - sig { returns(T.nilable(Prism::Location)) } + # a, (b, c) = 1, 2, 3 + # ^ + # + # source://prism//lib/prism/node.rb#11775 def rparen_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#13492 + # source://prism//lib/prism/node.rb#11803 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#13502 + # source://prism//lib/prism/node.rb#11808 def type; end end end @@ -23616,86 +21396,55 @@ end # a, b, c = 1, 2, 3 # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#13524 +# source://prism//lib/prism/node.rb#11830 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 + # Initialize a new MultiWriteNode node. # # @return [MultiWriteNode] a new instance of MultiWriteNode # - # source://prism//lib/prism/node.rb#13526 - 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 + # source://prism//lib/prism/node.rb#11832 + def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value); 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#13671 + # source://prism//lib/prism/node.rb#11997 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13539 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#11847 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13544 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11852 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13559 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#11867 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13549 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#11857 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?rest: ImplicitRestNode | SplatNode | nil, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode # - # source://prism//lib/prism/node.rb#13564 - 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 + # source://prism//lib/prism/node.rb#11872 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13544 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#11852 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], rest: ImplicitRestNode | SplatNode | nil, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#13572 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#11880 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -23703,102 +21452,106 @@ class Prism::MultiWriteNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13637 + # source://prism//lib/prism/node.rb#11981 sig { override.returns(String) } def inspect; end - # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] + # Represents the targets expressions before a splat node. # - # source://prism//lib/prism/node.rb#13577 - 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 + # a, b, * = 1, 2, 3, 4, 5 + # ^^^^ + # + # The splat node can be absent, in that case all target expressions are in the left field. + # + # a, b, c = 1, 2, 3, 4, 5 + # ^^^^^^^ + # + # source://prism//lib/prism/node.rb#11893 def lefts; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#13622 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#11966 def lparen; end - # attr_reader lparen_loc: Location? + # The location of the opening parenthesis. # - # source://prism//lib/prism/node.rb#13586 - sig { returns(T.nilable(Prism::Location)) } + # (a, b, c) = 1, 2, 3 + # ^ + # + # source://prism//lib/prism/node.rb#11921 def lparen_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#13632 - sig { returns(String) } + # source://prism//lib/prism/node.rb#11976 def operator; end - # attr_reader operator_loc: Location + # The location of the operator. # - # source://prism//lib/prism/node.rb#13612 - sig { returns(Prism::Location) } + # a, b, c = 1, 2, 3 + # ^ + # + # source://prism//lib/prism/node.rb#11953 def operator_loc; end - # attr_reader rest: Prism::node? + # Represents a splat node in the target expression. # - # source://prism//lib/prism/node.rb#13580 - sig { returns(T.nilable(Prism::Node)) } + # a, b, *c = 1, 2, 3, 4 + # ^^ + # + # The variable can be empty, this results in a `SplatNode` with a `nil` expression field. + # + # a, b, * = 1, 2, 3, 4 + # ^ + # + # If the `*` is omitted, the field will containt an `ImplicitRestNode` + # + # a, b, = 1, 2, 3, 4 + # ^ + # + # source://prism//lib/prism/node.rb#11909 def rest; end - # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] + # Represents the targets expressions after a splat node. # - # source://prism//lib/prism/node.rb#13583 - 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 + # a, *, b, c = 1, 2, 3, 4, 5 + # ^^^^ + # + # source://prism//lib/prism/node.rb#11915 def rights; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#13627 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#11971 def rparen; end - # attr_reader rparen_loc: Location? + # The location of the closing parenthesis. # - # source://prism//lib/prism/node.rb#13599 - sig { returns(T.nilable(Prism::Location)) } + # (a, b, c) = 1, 2, 3 + # ^ + # + # source://prism//lib/prism/node.rb#11937 def rparen_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#13655 + # source://prism//lib/prism/node.rb#11986 sig { override.returns(Symbol) } def type; end - # attr_reader value: Prism::node + # The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). # - # source://prism//lib/prism/node.rb#13619 - sig { returns(Prism::Node) } + # a, b, c = 1, 2, 3 + # ^^^^^^^ + # + # source://prism//lib/prism/node.rb#11963 def value; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#13665 + # source://prism//lib/prism/node.rb#11991 def type; end end end @@ -24570,82 +22323,60 @@ end # next 1 # ^^^^^^ # -# source://prism//lib/prism/node.rb#13689 +# source://prism//lib/prism/node.rb#12015 class Prism::NextNode < ::Prism::Node - # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void + # Initialize a new NextNode node. # # @return [NextNode] a new instance of NextNode # - # source://prism//lib/prism/node.rb#13691 - 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 + # source://prism//lib/prism/node.rb#12017 + def initialize(source, node_id, location, flags, arguments, keyword_loc); 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#13783 + # source://prism//lib/prism/node.rb#12093 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13699 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12027 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#13734 - sig { returns(T.nilable(Prism::ArgumentsNode)) } + # source://prism//lib/prism/node.rb#12062 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13704 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12032 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13716 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12044 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13709 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12037 def compact_child_nodes; end - # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> NextNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode # - # source://prism//lib/prism/node.rb#13721 - 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 + # source://prism//lib/prism/node.rb#12049 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13704 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12032 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: ArgumentsNode?, keyword_loc: Location } # - # source://prism//lib/prism/node.rb#13729 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12057 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -24653,50 +22384,30 @@ class Prism::NextNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13749 + # source://prism//lib/prism/node.rb#12077 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#13744 - sig { returns(String) } + # source://prism//lib/prism/node.rb#12072 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#13737 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#12065 def keyword_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#13767 + # source://prism//lib/prism/node.rb#12082 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#13777 + # source://prism//lib/prism/node.rb#12087 def type; end end end @@ -24706,63 +22417,55 @@ end # nil # ^^^ # -# source://prism//lib/prism/node.rb#13794 +# source://prism//lib/prism/node.rb#12104 class Prism::NilNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new NilNode node. # # @return [NilNode] a new instance of NilNode # - # source://prism//lib/prism/node.rb#13796 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#12106 + def initialize(source, node_id, location, flags); 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#13869 + # source://prism//lib/prism/node.rb#12163 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13802 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12114 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13807 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12119 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13817 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12129 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13812 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12124 def compact_child_nodes; end - # def copy: (?location: Location) -> NilNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> NilNode # - # source://prism//lib/prism/node.rb#13822 - sig { params(location: Prism::Location).returns(Prism::NilNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#12134 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13807 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12119 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#13830 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12142 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -24770,38 +22473,20 @@ class Prism::NilNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13835 + # source://prism//lib/prism/node.rb#12147 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#13853 + # source://prism//lib/prism/node.rb#12152 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#13863 + # source://prism//lib/prism/node.rb#12157 def type; end end end @@ -24812,76 +22497,55 @@ end # ^^^^^ # end # -# source://prism//lib/prism/node.rb#13879 +# source://prism//lib/prism/node.rb#12173 class Prism::NoKeywordsParameterNode < ::Prism::Node - # def initialize: (Location operator_loc, Location keyword_loc, Location location) -> void + # Initialize a new NoKeywordsParameterNode node. # # @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode # - # source://prism//lib/prism/node.rb#13881 - 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 + # source://prism//lib/prism/node.rb#12175 + def initialize(source, node_id, location, flags, operator_loc, keyword_loc); 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#13980 + # source://prism//lib/prism/node.rb#12258 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13889 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12185 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13894 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12190 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13904 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12200 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13899 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12195 def compact_child_nodes; end - # def copy: (?operator_loc: Location, ?keyword_loc: Location, ?location: Location) -> NoKeywordsParameterNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode # - # source://prism//lib/prism/node.rb#13909 - 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 + # source://prism//lib/prism/node.rb#12205 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13894 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12190 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, keyword_loc: Location } # - # source://prism//lib/prism/node.rb#13917 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12213 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -24889,62 +22553,40 @@ class Prism::NoKeywordsParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#13946 + # source://prism//lib/prism/node.rb#12242 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#13941 - sig { returns(String) } + # source://prism//lib/prism/node.rb#12237 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#13929 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#12225 def keyword_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#13936 - sig { returns(String) } + # source://prism//lib/prism/node.rb#12232 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#13922 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#12218 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#13964 + # source://prism//lib/prism/node.rb#12247 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#13974 + # source://prism//lib/prism/node.rb#12252 def type; end end end @@ -24960,16 +22602,26 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#131 + # source://prism//lib/prism/node.rb#169 sig { abstract.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # Returns the first node that matches the given block when visited in a + # depth-first search. This is useful for finding a node that matches a + # particular condition. + # + # node.breadth_first_search { |node| node.node_id == node_id } + # + # source://prism//lib/prism/node.rb#139 + sig { params(block: T.proc.params(node: Prism::Node).returns(T::Boolean)).returns(T.nilable(Prism::Node)) } + def breadth_first_search(&block); end + # Returns an array of child nodes, including `nil`s in the place of optional # nodes that were not present. # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#137 + # source://prism//lib/prism/node.rb#175 sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end @@ -24978,7 +22630,7 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#151 + # source://prism//lib/prism/node.rb#189 sig { abstract.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end @@ -24987,7 +22639,7 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#145 + # source://prism//lib/prism/node.rb#183 sig { abstract.returns(T::Array[Prism::Node]) } def compact_child_nodes; end @@ -24996,7 +22648,7 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#137 + # source://prism//lib/prism/node.rb#175 sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end @@ -25006,7 +22658,7 @@ class Prism::Node # 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 + # source://prism//lib/prism/node.rb#40 sig { returns(Integer) } def end_offset; end @@ -25017,29 +22669,46 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#162 + # source://prism//lib/prism/node.rb#194 sig { abstract.returns(String) } def inspect; end # A Location instance that represents the location of this node in the # source. # - # source://prism//lib/prism/node.rb#19 + # source://prism//lib/prism/node.rb#25 sig { returns(Prism::Location) } def location; end + # Returns true if the node has the newline flag set. + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#72 + sig { returns(T::Boolean) } + def newline?; end + # source://prism//lib/prism/parse_result/newlines.rb#69 - def newline!(lines); end + def newline_flag!(lines); end # @return [Boolean] # # source://prism//lib/prism/parse_result/newlines.rb#65 - def newline?; end + def newline_flag?; end + + # A unique identifier for this node. This is used in a very specific + # use case where you want to keep around a reference to a node without + # having to keep around the syntax tree in memory. This unique identifier + # will be consistent across multiple parses of the same source code. + # + # source://prism//lib/prism/node.rb#21 + sig { returns(Integer) } + def node_id; end # Similar to inspect, but respects the current level of indentation given by # the pretty print object. # - # source://prism//lib/prism/node.rb#62 + # source://prism//lib/prism/node.rb#83 sig { params(q: T.untyped).void } def pretty_print(q); end @@ -25047,13 +22716,13 @@ class Prism::Node # An alias for source_lines, used to mimic the API from # RubyVM::AbstractSyntaxTree to make it easier to migrate. # - # source://prism//lib/prism/node.rb#40 + # source://prism//lib/prism/node.rb#46 sig { returns(T::Array[String]) } def script_lines; end # Slice the location of the node from the source. # - # source://prism//lib/prism/node.rb#49 + # source://prism//lib/prism/node.rb#55 sig { returns(String) } def slice; end @@ -25061,26 +22730,34 @@ class Prism::Node # of the line that the location starts on, ending at the end of the line # that the location ends on. # - # source://prism//lib/prism/node.rb#56 + # source://prism//lib/prism/node.rb#62 sig { returns(String) } def slice_lines; end # Returns all of the lines of the source code associated with this node. # - # source://prism//lib/prism/node.rb#40 + # source://prism//lib/prism/node.rb#46 sig { returns(T::Array[String]) } def source_lines; 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 + # source://prism//lib/prism/node.rb#33 sig { returns(Integer) } def start_offset; end + # Returns true if the node has the static literal flag set. + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#77 + sig { returns(T::Boolean) } + def static_literal?; end + # Convert this node into a graphviz dot graph string. # - # source://prism//lib/prism/node.rb#70 + # source://prism//lib/prism/node.rb#91 sig { returns(String) } def to_dot; end @@ -25091,19 +22768,38 @@ class Prism::Node # Important to note is that the column given to this method should be in # bytes, as opposed to characters or code units. # - # source://prism//lib/prism/node.rb#81 + # source://prism//lib/prism/node.rb#102 sig { params(line: Integer, column: Integer).returns(T::Array[Prism::Node]) } def tunnel(line, column); end - # Returns a symbol symbolizing the type of node that this represents. This - # is particularly useful for case statements and array comparisons. + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#157 + # source://prism//lib/prism/node.rb#210 sig { abstract.returns(Symbol) } def type; end + protected + + # An bitset of flags for this node. There are certain flags that are common + # for all nodes, and then some nodes have specific flags. + # + # source://prism//lib/prism/node.rb#68 + sig { returns(Integer) } + def flags; end + private # A pointer to the source that this node was created from. @@ -25119,80 +22815,92 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#115 + # source://prism//lib/prism/node.rb#153 def fields; end - # Returns the type of the node as a symbol. + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#167 + # source://prism//lib/prism/node.rb#218 def type; end end end +# The flags that are common to all nodes. +# +# source://prism//lib/prism/node.rb#16812 +module Prism::NodeFlags; end + +# A flag to indicate that the node is a candidate to emit a :line event +# through tracepoint when compiled. +# +# source://prism//lib/prism/node.rb#16815 +Prism::NodeFlags::NEWLINE = T.let(T.unsafe(nil), Integer) + +# A flag to indicate that the value that the node represents is a value that +# can be determined at parse-time. +# +# source://prism//lib/prism/node.rb#16819 +Prism::NodeFlags::STATIC_LITERAL = T.let(T.unsafe(nil), Integer) + # Represents an implicit set of parameters through the use of numbered parameters within a block or lambda. # # -> { _1 + _2 } # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#13991 +# source://prism//lib/prism/node.rb#12269 class Prism::NumberedParametersNode < ::Prism::Node - # def initialize: (Integer maximum, Location location) -> void + # Initialize a new NumberedParametersNode node. # # @return [NumberedParametersNode] a new instance of NumberedParametersNode # - # source://prism//lib/prism/node.rb#13993 - sig { params(source: Prism::Source, maximum: Integer, location: Prism::Location).void } - def initialize(source, maximum, location); end + # source://prism//lib/prism/node.rb#12271 + def initialize(source, node_id, location, flags, maximum); 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#14070 + # source://prism//lib/prism/node.rb#12332 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14000 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12280 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14005 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12285 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14015 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12295 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14010 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12290 def compact_child_nodes; end - # def copy: (?maximum: Integer, ?location: Location) -> NumberedParametersNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode # - # source://prism//lib/prism/node.rb#14020 - sig { params(maximum: Integer, location: Prism::Location).returns(Prism::NumberedParametersNode) } - def copy(maximum: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#12300 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), maximum: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14005 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12285 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { maximum: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, maximum: Integer } # - # source://prism//lib/prism/node.rb#14028 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12308 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -25200,44 +22908,25 @@ class Prism::NumberedParametersNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14036 + # source://prism//lib/prism/node.rb#12316 sig { override.returns(String) } def inspect; end # attr_reader maximum: Integer # - # source://prism//lib/prism/node.rb#14033 - sig { returns(Integer) } + # source://prism//lib/prism/node.rb#12313 def maximum; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#14054 + # source://prism//lib/prism/node.rb#12321 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#14064 + # source://prism//lib/prism/node.rb#12326 def type; end end end @@ -25247,63 +22936,55 @@ end # $1 # ^^ # -# source://prism//lib/prism/node.rb#14080 +# source://prism//lib/prism/node.rb#12342 class Prism::NumberedReferenceReadNode < ::Prism::Node - # def initialize: (Integer number, Location location) -> void + # Initialize a new NumberedReferenceReadNode node. # # @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode # - # source://prism//lib/prism/node.rb#14082 - sig { params(source: Prism::Source, number: Integer, location: Prism::Location).void } - def initialize(source, number, location); end + # source://prism//lib/prism/node.rb#12344 + def initialize(source, node_id, location, flags, number); 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#14165 + # source://prism//lib/prism/node.rb#12411 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14089 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12353 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14094 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12358 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14104 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12368 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14099 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12363 def compact_child_nodes; end - # def copy: (?number: Integer, ?location: Location) -> NumberedReferenceReadNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode # - # source://prism//lib/prism/node.rb#14109 - sig { params(number: Integer, location: Prism::Location).returns(Prism::NumberedReferenceReadNode) } - def copy(number: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#12373 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), number: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14094 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12358 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { number: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, number: Integer } # - # source://prism//lib/prism/node.rb#14117 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12381 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -25311,7 +22992,7 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14131 + # source://prism//lib/prism/node.rb#12395 sig { override.returns(String) } def inspect; end @@ -25323,38 +23004,19 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node # # $4294967296 # number `0` # - # source://prism//lib/prism/node.rb#14128 - sig { returns(Integer) } + # source://prism//lib/prism/node.rb#12392 def number; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#14149 + # source://prism//lib/prism/node.rb#12400 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#14159 + # source://prism//lib/prism/node.rb#12405 def type; end end end @@ -25365,79 +23027,81 @@ end # ^^^^ # end # -# source://prism//lib/prism/node.rb#14176 +# source://prism//lib/prism/node.rb#12422 class Prism::OptionalKeywordParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location name_loc, Prism::node value, Location location) -> void + # Initialize a new OptionalKeywordParameterNode node. # # @return [OptionalKeywordParameterNode] a new instance of OptionalKeywordParameterNode # - # source://prism//lib/prism/node.rb#14178 + # source://prism//lib/prism/node.rb#12424 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, name: Symbol, name_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).void end - def initialize(source, flags, name, name_loc, value, location); end + def initialize(source, node_id, location, flags, name, name_loc, value); 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#14277 + # source://prism//lib/prism/node.rb#12502 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14188 + # source://prism//lib/prism/node.rb#12435 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#14193 + # source://prism//lib/prism/node.rb#12440 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#14203 + # source://prism//lib/prism/node.rb#12450 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#14198 + # source://prism//lib/prism/node.rb#12445 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode # - # source://prism//lib/prism/node.rb#14208 + # source://prism//lib/prism/node.rb#12455 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, name: Symbol, name_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14193 + # source://prism//lib/prism/node.rb#12440 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#14216 + # source://prism//lib/prism/node.rb#12463 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -25446,19 +23110,19 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14243 + # source://prism//lib/prism/node.rb#12486 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#14225 + # source://prism//lib/prism/node.rb#12473 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#14228 + # source://prism//lib/prism/node.rb#12476 sig { returns(Prism::Location) } def name_loc; end @@ -25466,52 +23130,26 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#14238 + # source://prism//lib/prism/node.rb#12468 sig { returns(T::Boolean) } def repeated_parameter?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#14261 + # source://prism//lib/prism/node.rb#12491 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#14235 + # source://prism//lib/prism/node.rb#12483 sig { returns(Prism::Node) } def value; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#14221 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#14271 + # source://prism//lib/prism/node.rb#12496 def type; end end end @@ -25522,81 +23160,83 @@ end # ^^^^^ # end # -# source://prism//lib/prism/node.rb#14291 +# source://prism//lib/prism/node.rb#12516 class Prism::OptionalParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # Initialize a new OptionalParameterNode node. # # @return [OptionalParameterNode] a new instance of OptionalParameterNode # - # source://prism//lib/prism/node.rb#14293 + # source://prism//lib/prism/node.rb#12518 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, name: Symbol, name_loc: Prism::Location, operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).void end - def initialize(source, flags, name, name_loc, operator_loc, value, location); end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); 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#14405 + # source://prism//lib/prism/node.rb#12609 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14304 + # source://prism//lib/prism/node.rb#12530 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#14309 + # source://prism//lib/prism/node.rb#12535 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#14319 + # source://prism//lib/prism/node.rb#12545 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#14314 + # source://prism//lib/prism/node.rb#12540 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode # - # source://prism//lib/prism/node.rb#14324 + # source://prism//lib/prism/node.rb#12550 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, name: Symbol, name_loc: Prism::Location, operator_loc: Prism::Location, - value: Prism::Node, - location: Prism::Location + value: Prism::Node ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14309 + # source://prism//lib/prism/node.rb#12535 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } # - # source://prism//lib/prism/node.rb#14332 + # source://prism//lib/prism/node.rb#12558 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -25605,31 +23245,31 @@ class Prism::OptionalParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14371 + # source://prism//lib/prism/node.rb#12593 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#14341 + # source://prism//lib/prism/node.rb#12568 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#14344 + # source://prism//lib/prism/node.rb#12571 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#14366 + # source://prism//lib/prism/node.rb#12588 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#14351 + # source://prism//lib/prism/node.rb#12578 sig { returns(Prism::Location) } def operator_loc; end @@ -25637,52 +23277,26 @@ class Prism::OptionalParameterNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#14361 + # source://prism//lib/prism/node.rb#12563 sig { returns(T::Boolean) } def repeated_parameter?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#14389 + # source://prism//lib/prism/node.rb#12598 sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#14358 + # source://prism//lib/prism/node.rb#12585 sig { returns(Prism::Node) } def value; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#14337 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#14399 + # source://prism//lib/prism/node.rb#12603 def type; end end end @@ -25692,78 +23306,55 @@ end # left or right # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#14419 +# source://prism//lib/prism/node.rb#12623 class Prism::OrNode < ::Prism::Node - # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void + # Initialize a new OrNode node. # # @return [OrNode] a new instance of OrNode # - # source://prism//lib/prism/node.rb#14421 - 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 + # source://prism//lib/prism/node.rb#12625 + def initialize(source, node_id, location, flags, left, right, operator_loc); 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#14530 + # source://prism//lib/prism/node.rb#12718 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14430 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12636 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14435 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12641 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14445 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12651 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14440 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12646 def compact_child_nodes; end - # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> OrNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode # - # source://prism//lib/prism/node.rb#14450 - 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 + # source://prism//lib/prism/node.rb#12656 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14435 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12641 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#14458 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12664 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -25771,7 +23362,7 @@ class Prism::OrNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14496 + # source://prism//lib/prism/node.rb#12702 sig { override.returns(String) } def inspect; end @@ -25783,14 +23374,12 @@ class Prism::OrNode < ::Prism::Node # 1 || 2 # ^ # - # source://prism//lib/prism/node.rb#14469 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#12675 def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#14491 - sig { returns(String) } + # source://prism//lib/prism/node.rb#12697 def operator; end # The location of the `or` keyword or the `||` operator. @@ -25798,8 +23387,7 @@ class Prism::OrNode < ::Prism::Node # left or right # ^^ # - # source://prism//lib/prism/node.rb#14484 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#12690 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). @@ -25810,38 +23398,19 @@ class Prism::OrNode < ::Prism::Node # 1 or 2 # ^ # - # source://prism//lib/prism/node.rb#14478 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#12684 def right; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#14514 + # source://prism//lib/prism/node.rb#12707 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#14524 + # source://prism//lib/prism/node.rb#12712 def type; end end end @@ -26090,12 +23659,12 @@ Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) # Flags for parameter nodes. # -# source://prism//lib/prism/node.rb#19202 +# source://prism//lib/prism/node.rb#16725 module Prism::ParameterFlags; end # a parameter name that has been repeated in the method signature # -# source://prism//lib/prism/node.rb#19204 +# source://prism//lib/prism/node.rb#16727 Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer) # Represents the list of parameters on a method, block, or lambda definition. @@ -26104,92 +23673,60 @@ Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer) # ^^^^^^^ # end # -# source://prism//lib/prism/node.rb#14543 +# source://prism//lib/prism/node.rb#12731 class Prism::ParametersNode < ::Prism::Node - # def initialize: (Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] 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#14545 - 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, Prism::ForwardingParameterNode)], - 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 + # Initialize a new ParametersNode node. + # + # @return [ParametersNode] a new instance of ParametersNode + # + # source://prism//lib/prism/node.rb#12733 + def initialize(source, node_id, location, flags, requireds, optionals, rest, posts, keywords, keyword_rest, block); 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#14654 + # source://prism//lib/prism/node.rb#12826 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14558 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12748 def accept(visitor); end # attr_reader block: BlockParameterNode? # - # source://prism//lib/prism/node.rb#14617 - sig { returns(T.nilable(Prism::BlockParameterNode)) } + # source://prism//lib/prism/node.rb#12807 def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14563 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12753 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14581 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12771 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14568 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12758 def compact_child_nodes; end - # def copy: (?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?, ?location: Location) -> ParametersNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?) -> ParametersNode # - # source://prism//lib/prism/node.rb#14586 - 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, Prism::ForwardingParameterNode)], - 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 + # source://prism//lib/prism/node.rb#12776 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), requireds: T.unsafe(nil), optionals: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), keywords: T.unsafe(nil), keyword_rest: T.unsafe(nil), block: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14563 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12753 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 | ForwardingParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode? } # - # source://prism//lib/prism/node.rb#14594 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12784 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -26197,84 +23734,56 @@ class Prism::ParametersNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14620 + # source://prism//lib/prism/node.rb#12810 sig { override.returns(String) } def inspect; end # attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil # - # source://prism//lib/prism/node.rb#14614 - sig do - returns(T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode))) - end + # source://prism//lib/prism/node.rb#12804 def keyword_rest; end # attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] # - # source://prism//lib/prism/node.rb#14611 - sig { returns(T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)]) } + # source://prism//lib/prism/node.rb#12801 def keywords; end # attr_reader optionals: Array[OptionalParameterNode] # - # source://prism//lib/prism/node.rb#14602 - sig { returns(T::Array[Prism::OptionalParameterNode]) } + # source://prism//lib/prism/node.rb#12792 def optionals; end # attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] # - # source://prism//lib/prism/node.rb#14608 - sig do - returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)]) - end + # source://prism//lib/prism/node.rb#12798 def posts; end # attr_reader requireds: Array[RequiredParameterNode | MultiTargetNode] # - # source://prism//lib/prism/node.rb#14599 - sig { returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)]) } + # source://prism//lib/prism/node.rb#12789 def requireds; end # attr_reader rest: RestParameterNode | ImplicitRestNode | nil # - # source://prism//lib/prism/node.rb#14605 - sig { returns(T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode))) } + # source://prism//lib/prism/node.rb#12795 def rest; end # Mirrors the Method#parameters method. # - # source://prism//lib/prism/node_ext.rb#253 + # source://prism//lib/prism/node_ext.rb#269 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 - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#14638 + # source://prism//lib/prism/node.rb#12815 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#14648 + # source://prism//lib/prism/node.rb#12820 def type; end end end @@ -26284,96 +23793,70 @@ end # (10 + 34) # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#14674 +# source://prism//lib/prism/node.rb#12846 class Prism::ParenthesesNode < ::Prism::Node - # def initialize: (Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void + # Initialize a new ParenthesesNode node. # # @return [ParenthesesNode] a new instance of ParenthesesNode # - # source://prism//lib/prism/node.rb#14676 - 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 + # source://prism//lib/prism/node.rb#12848 + def initialize(source, node_id, location, flags, body, opening_loc, closing_loc); 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#14781 + # source://prism//lib/prism/node.rb#12937 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14685 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12859 def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#14720 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#12894 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14690 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12864 def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#14742 - sig { returns(String) } + # source://prism//lib/prism/node.rb#12916 def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#14730 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#12904 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14702 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12876 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14695 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12869 def compact_child_nodes; end - # def copy: (?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> ParenthesesNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode # - # source://prism//lib/prism/node.rb#14707 - 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 + # source://prism//lib/prism/node.rb#12881 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14690 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12864 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, body: Prism::node?, opening_loc: Location, closing_loc: Location } # - # source://prism//lib/prism/node.rb#14715 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12889 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -26381,116 +23864,96 @@ class Prism::ParenthesesNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14747 + # source://prism//lib/prism/node.rb#12921 sig { override.returns(String) } def inspect; end # source://prism//lib/prism/parse_result/newlines.rb#85 - def newline!(lines); end + def newline_flag!(lines); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#14737 - sig { returns(String) } + # source://prism//lib/prism/node.rb#12911 def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#14723 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#12897 def opening_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#14765 + # source://prism//lib/prism/node.rb#12926 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#14775 + # source://prism//lib/prism/node.rb#12931 def type; end end end # This represents an error that was encountered during parsing. # -# source://prism//lib/prism/parse_result.rb#451 +# source://prism//lib/prism/parse_result.rb#460 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#466 + # source://prism//lib/prism/parse_result.rb#475 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#474 + # source://prism//lib/prism/parse_result.rb#483 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#479 + # source://prism//lib/prism/parse_result.rb#488 sig { returns(String) } def inspect; end # The level of this error. # - # source://prism//lib/prism/parse_result.rb#463 + # source://prism//lib/prism/parse_result.rb#472 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#460 + # source://prism//lib/prism/parse_result.rb#469 sig { returns(Prism::Location) } def location; end # The message associated with this error. # - # source://prism//lib/prism/parse_result.rb#457 + # source://prism//lib/prism/parse_result.rb#466 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#454 + # source://prism//lib/prism/parse_result.rb#463 sig { returns(Symbol) } def type; end end # This is a result specific to the `parse_lex` and `parse_lex_file` methods. # -# source://prism//lib/prism/parse_result.rb#627 +# source://prism//lib/prism/parse_result.rb#644 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#633 + # source://prism//lib/prism/parse_result.rb#650 sig do params( value: [Prism::ProgramNode, T::Array[T.untyped]], @@ -26506,27 +23969,27 @@ class Prism::ParseLexResult < ::Prism::Result # Implement the hash pattern matching interface for ParseLexResult. # - # source://prism//lib/prism/parse_result.rb#639 + # source://prism//lib/prism/parse_result.rb#656 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#630 + # source://prism//lib/prism/parse_result.rb#647 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#576 +# source://prism//lib/prism/parse_result.rb#585 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#587 + # source://prism//lib/prism/parse_result.rb#598 sig do params( value: Prism::ProgramNode, @@ -26542,24 +24005,30 @@ class Prism::ParseResult < ::Prism::Result # Attach the list of comments to their respective locations in the tree. # - # source://prism//lib/prism/parse_result.rb#598 + # source://prism//lib/prism/parse_result.rb#609 def attach_comments!; end # Implement the hash pattern matching interface for ParseResult. # - # source://prism//lib/prism/parse_result.rb#593 + # source://prism//lib/prism/parse_result.rb#604 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + # Returns a string representation of the syntax tree with the errors + # displayed inline. + # + # source://prism//lib/prism/parse_result.rb#621 + def errors_format; end + # Walk the tree and mark nodes that are on a new line, loosely emulating # the behavior of CRuby's `:line` tracepoint event. # - # source://prism//lib/prism/parse_result.rb#604 + # source://prism//lib/prism/parse_result.rb#615 def mark_newlines!; end # The syntax tree that was parsed from the source code. # - # source://prism//lib/prism/parse_result.rb#584 + # source://prism//lib/prism/parse_result.rb#595 sig { returns(Prism::ProgramNode) } def value; end end @@ -26671,6 +24140,29 @@ class Prism::ParseResult::Comments::NodeTarget def trailing_comment(comment); end end +# An object to represent the set of errors on a parse result. This object +# can be used to format the errors in a human-readable way. +# +# source://prism//lib/prism/parse_result/errors.rb#9 +class Prism::ParseResult::Errors + # Initialize a new set of errors from the given parse result. + # + # @return [Errors] a new instance of Errors + # + # source://prism//lib/prism/parse_result/errors.rb#14 + def initialize(parse_result); end + + # Formats the errors in a human-readable way and return them as a string. + # + # source://prism//lib/prism/parse_result/errors.rb#19 + def format; end + + # The parse result that contains the errors. + # + # source://prism//lib/prism/parse_result/errors.rb#11 + def parse_result; end +end + # The :line tracepoint event gets fired whenever the Ruby VM encounters an # expression on a new line. The types of expressions that can trigger this # event are: @@ -26729,50 +24221,50 @@ end # This represents a warning that was encountered during parsing. # -# source://prism//lib/prism/parse_result.rb#485 +# source://prism//lib/prism/parse_result.rb#494 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#500 + # source://prism//lib/prism/parse_result.rb#509 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#508 + # source://prism//lib/prism/parse_result.rb#517 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#513 + # source://prism//lib/prism/parse_result.rb#522 sig { returns(String) } def inspect; end # The level of this warning. # - # source://prism//lib/prism/parse_result.rb#497 + # source://prism//lib/prism/parse_result.rb#506 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#494 + # source://prism//lib/prism/parse_result.rb#503 sig { returns(Prism::Location) } def location; end # The message associated with this warning. # - # source://prism//lib/prism/parse_result.rb#491 + # source://prism//lib/prism/parse_result.rb#500 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#488 + # source://prism//lib/prism/parse_result.rb#497 sig { returns(Symbol) } def type; end end @@ -26943,86 +24435,60 @@ end # foo in ^(bar) # ^^^^^^ # -# source://prism//lib/prism/node.rb#14793 +# source://prism//lib/prism/node.rb#12949 class Prism::PinnedExpressionNode < ::Prism::Node - # def initialize: (Prism::node expression, Location operator_loc, Location lparen_loc, Location rparen_loc, Location location) -> void + # Initialize a new PinnedExpressionNode node. # # @return [PinnedExpressionNode] a new instance of PinnedExpressionNode # - # source://prism//lib/prism/node.rb#14795 - 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 + # source://prism//lib/prism/node.rb#12951 + def initialize(source, node_id, location, flags, expression, operator_loc, lparen_loc, rparen_loc); 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#14911 + # source://prism//lib/prism/node.rb#13051 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14805 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#12963 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14810 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12968 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14820 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#12978 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14815 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#12973 def compact_child_nodes; end - # def copy: (?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location, ?location: Location) -> PinnedExpressionNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode # - # source://prism//lib/prism/node.rb#14825 - 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 + # source://prism//lib/prism/node.rb#12983 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14810 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#12968 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location } # - # source://prism//lib/prism/node.rb#14833 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#12991 def deconstruct_keys(keys); end # attr_reader expression: Prism::node # - # source://prism//lib/prism/node.rb#14838 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#12996 def expression; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -27030,74 +24496,50 @@ class Prism::PinnedExpressionNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14877 + # source://prism//lib/prism/node.rb#13035 sig { override.returns(String) } def inspect; end # def lparen: () -> String # - # source://prism//lib/prism/node.rb#14867 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13025 def lparen; end # attr_reader lparen_loc: Location # - # source://prism//lib/prism/node.rb#14848 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13006 def lparen_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#14862 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13020 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#14841 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#12999 def operator_loc; end # def rparen: () -> String # - # source://prism//lib/prism/node.rb#14872 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13030 def rparen; end # attr_reader rparen_loc: Location # - # source://prism//lib/prism/node.rb#14855 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13013 def rparen_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#14895 + # source://prism//lib/prism/node.rb#13040 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#14905 + # source://prism//lib/prism/node.rb#13045 def type; end end end @@ -27107,76 +24549,55 @@ end # foo in ^bar # ^^^^ # -# source://prism//lib/prism/node.rb#14924 +# source://prism//lib/prism/node.rb#13064 class Prism::PinnedVariableNode < ::Prism::Node - # def initialize: (Prism::node variable, Location operator_loc, Location location) -> void + # Initialize a new PinnedVariableNode node. # # @return [PinnedVariableNode] a new instance of PinnedVariableNode # - # source://prism//lib/prism/node.rb#14926 - 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 + # source://prism//lib/prism/node.rb#13066 + def initialize(source, node_id, location, flags, variable, operator_loc); 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#15016 + # source://prism//lib/prism/node.rb#13140 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14934 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#13076 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14939 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13081 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14949 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#13091 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14944 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#13086 def compact_child_nodes; end - # def copy: (?variable: Prism::node, ?operator_loc: Location, ?location: Location) -> PinnedVariableNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: Prism::node, ?operator_loc: Location) -> PinnedVariableNode # - # source://prism//lib/prism/node.rb#14954 - 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 + # source://prism//lib/prism/node.rb#13096 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), variable: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14939 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13081 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { variable: Prism::node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, variable: Prism::node, operator_loc: Location } # - # source://prism//lib/prism/node.rb#14962 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#13104 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -27184,56 +24605,35 @@ class Prism::PinnedVariableNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#14982 + # source://prism//lib/prism/node.rb#13124 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#14977 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13119 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#14970 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13112 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#15000 + # source://prism//lib/prism/node.rb#13129 sig { override.returns(Symbol) } def type; end # attr_reader variable: Prism::node # - # source://prism//lib/prism/node.rb#14967 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#13109 def variable; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#15010 + # source://prism//lib/prism/node.rb#13134 def type; end end end @@ -27243,92 +24643,65 @@ end # END { foo } # ^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#15027 +# source://prism//lib/prism/node.rb#13151 class Prism::PostExecutionNode < ::Prism::Node - # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void + # Initialize a new PostExecutionNode node. # # @return [PostExecutionNode] a new instance of PostExecutionNode # - # source://prism//lib/prism/node.rb#15029 - 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 + # source://prism//lib/prism/node.rb#13153 + def initialize(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc); 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#15147 + # source://prism//lib/prism/node.rb#13255 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15039 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#13165 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15044 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13170 def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#15108 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13234 def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#15091 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13217 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15056 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#13182 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15049 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#13175 def compact_child_nodes; end - # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PostExecutionNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode # - # source://prism//lib/prism/node.rb#15061 - 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 + # source://prism//lib/prism/node.rb#13187 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15044 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13170 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location } # - # source://prism//lib/prism/node.rb#15069 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#13195 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -27336,68 +24709,45 @@ class Prism::PostExecutionNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#15113 + # source://prism//lib/prism/node.rb#13239 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#15098 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13224 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#15077 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13203 def keyword_loc; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#15103 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13229 def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#15084 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13210 def opening_loc; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#15074 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#13200 def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#15131 + # source://prism//lib/prism/node.rb#13244 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#15141 + # source://prism//lib/prism/node.rb#13249 def type; end end end @@ -27407,92 +24757,65 @@ end # BEGIN { foo } # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#15160 +# source://prism//lib/prism/node.rb#13268 class Prism::PreExecutionNode < ::Prism::Node - # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void + # Initialize a new PreExecutionNode node. # # @return [PreExecutionNode] a new instance of PreExecutionNode # - # source://prism//lib/prism/node.rb#15162 - 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 + # source://prism//lib/prism/node.rb#13270 + def initialize(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc); 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#15280 + # source://prism//lib/prism/node.rb#13372 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15172 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#13282 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15177 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13287 def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#15241 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13351 def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#15224 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13334 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15189 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#13299 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15182 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#13292 def compact_child_nodes; end - # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PreExecutionNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode # - # source://prism//lib/prism/node.rb#15194 - 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 + # source://prism//lib/prism/node.rb#13304 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15177 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13287 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location } # - # source://prism//lib/prism/node.rb#15202 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#13312 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -27500,144 +24823,100 @@ class Prism::PreExecutionNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#15246 + # source://prism//lib/prism/node.rb#13356 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#15231 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13341 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#15210 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13320 def keyword_loc; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#15236 - sig { returns(String) } + # source://prism//lib/prism/node.rb#13346 def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#15217 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#13327 def opening_loc; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#15207 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#13317 def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#15264 + # source://prism//lib/prism/node.rb#13361 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#15274 + # source://prism//lib/prism/node.rb#13366 def type; end end end # The top level node of any parse tree. # -# source://prism//lib/prism/node.rb#15290 +# source://prism//lib/prism/node.rb#13382 class Prism::ProgramNode < ::Prism::Node - # def initialize: (Array[Symbol] locals, StatementsNode statements, Location location) -> void + # Initialize a new ProgramNode node. # # @return [ProgramNode] a new instance of ProgramNode # - # source://prism//lib/prism/node.rb#15292 - 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 + # source://prism//lib/prism/node.rb#13384 + def initialize(source, node_id, location, flags, locals, statements); 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#15373 + # source://prism//lib/prism/node.rb#13449 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15300 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#13394 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15305 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13399 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15315 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#13409 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15310 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#13404 def compact_child_nodes; end - # def copy: (?locals: Array[Symbol], ?statements: StatementsNode, ?location: Location) -> ProgramNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode # - # source://prism//lib/prism/node.rb#15320 - 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 + # source://prism//lib/prism/node.rb#13414 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), statements: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15305 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13399 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], statements: StatementsNode, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], statements: StatementsNode } # - # source://prism//lib/prism/node.rb#15328 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#13422 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -27645,62 +24924,42 @@ class Prism::ProgramNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#15339 + # source://prism//lib/prism/node.rb#13433 sig { override.returns(String) } def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#15333 - sig { returns(T::Array[Symbol]) } + # source://prism//lib/prism/node.rb#13427 def locals; end # attr_reader statements: StatementsNode # - # source://prism//lib/prism/node.rb#15336 - sig { returns(Prism::StatementsNode) } + # source://prism//lib/prism/node.rb#13430 def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#15357 + # source://prism//lib/prism/node.rb#13438 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#15367 + # source://prism//lib/prism/node.rb#13443 def type; end end end # Flags for range and flip-flop nodes. # -# source://prism//lib/prism/node.rb#19208 +# source://prism//lib/prism/node.rb#16731 module Prism::RangeFlags; end # ... operator # -# source://prism//lib/prism/node.rb#19210 +# source://prism//lib/prism/node.rb#16733 Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) # Represents the use of the `..` or `...` operators. @@ -27711,79 +24970,81 @@ Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) # c if a =~ /left/ ... b =~ /right/ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#15388 +# source://prism//lib/prism/node.rb#13464 class Prism::RangeNode < ::Prism::Node - # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void + # Initialize a new RangeNode node. # # @return [RangeNode] a new instance of RangeNode # - # source://prism//lib/prism/node.rb#15390 + # source://prism//lib/prism/node.rb#13466 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, left: T.nilable(Prism::Node), right: T.nilable(Prism::Node), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: Prism::Location ).void end - def initialize(source, flags, left, right, operator_loc, location); end + def initialize(source, node_id, location, flags, left, right, operator_loc); 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#15510 + # source://prism//lib/prism/node.rb#13565 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15400 + # source://prism//lib/prism/node.rb#13477 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#15405 + # source://prism//lib/prism/node.rb#13482 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#15418 + # source://prism//lib/prism/node.rb#13495 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#15410 + # source://prism//lib/prism/node.rb#13487 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode # - # source://prism//lib/prism/node.rb#15423 + # source://prism//lib/prism/node.rb#13500 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, left: T.nilable(Prism::Node), right: T.nilable(Prism::Node), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15405 + # source://prism//lib/prism/node.rb#13482 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node?, right: Prism::node?, operator_loc: Location } # - # source://prism//lib/prism/node.rb#15431 + # source://prism//lib/prism/node.rb#13508 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -27791,7 +25052,7 @@ class Prism::RangeNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15466 + # source://prism//lib/prism/node.rb#13513 sig { returns(T::Boolean) } def exclude_end?; end @@ -27800,7 +25061,7 @@ class Prism::RangeNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#15476 + # source://prism//lib/prism/node.rb#13549 sig { override.returns(String) } def inspect; end @@ -27812,19 +25073,19 @@ class Prism::RangeNode < ::Prism::Node # hello...goodbye # ^^^^^ # - # source://prism//lib/prism/node.rb#15446 + # source://prism//lib/prism/node.rb#13524 sig { returns(T.nilable(Prism::Node)) } def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#15471 + # source://prism//lib/prism/node.rb#13544 sig { returns(String) } def operator; end # The location of the `..` or `...` operator. # - # source://prism//lib/prism/node.rb#15459 + # source://prism//lib/prism/node.rb#13537 sig { returns(Prism::Location) } def operator_loc; end @@ -27837,46 +25098,20 @@ 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#15456 + # source://prism//lib/prism/node.rb#13534 sig { returns(T.nilable(Prism::Node)) } def right; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#15494 + # source://prism//lib/prism/node.rb#13554 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#15436 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#15504 + # source://prism//lib/prism/node.rb#13559 def type; end end end @@ -27886,33 +25121,34 @@ end # 1.0r # ^^^^ # -# source://prism//lib/prism/node.rb#15523 +# source://prism//lib/prism/node.rb#13578 class Prism::RationalNode < ::Prism::Node - # def initialize: (Integer flags, Integer numerator, Integer denominator, Location location) -> void + # Initialize a new RationalNode node. # # @return [RationalNode] a new instance of RationalNode # - # source://prism//lib/prism/node.rb#15525 + # source://prism//lib/prism/node.rb#13580 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, numerator: Integer, - denominator: Integer, - location: Prism::Location + denominator: Integer ).void end - def initialize(source, flags, numerator, denominator, location); end + def initialize(source, node_id, location, flags, numerator, denominator); 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#15635 + # source://prism//lib/prism/node.rb#13669 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15534 + # source://prism//lib/prism/node.rb#13590 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -27920,59 +25156,60 @@ class Prism::RationalNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15581 + # source://prism//lib/prism/node.rb#13623 sig { returns(T::Boolean) } def binary?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15539 + # source://prism//lib/prism/node.rb#13595 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#15549 + # source://prism//lib/prism/node.rb#13605 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#15544 + # source://prism//lib/prism/node.rb#13600 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (?flags: Integer, ?numerator: Integer, ?denominator: Integer, ?location: Location) -> RationalNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode # - # source://prism//lib/prism/node.rb#15554 + # source://prism//lib/prism/node.rb#13610 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, numerator: Integer, - denominator: Integer, - location: Prism::Location + denominator: Integer ).returns(Prism::RationalNode) end - def copy(flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil), location: T.unsafe(nil)); end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil)); end # def decimal?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15586 + # source://prism//lib/prism/node.rb#13628 sig { returns(T::Boolean) } def decimal?; end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15539 + # source://prism//lib/prism/node.rb#13595 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, numerator: Integer, denominator: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numerator: Integer, denominator: Integer } # - # source://prism//lib/prism/node.rb#15562 + # source://prism//lib/prism/node.rb#13618 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -27980,7 +25217,7 @@ class Prism::RationalNode < ::Prism::Node # # 1.5r # denominator 2 # - # source://prism//lib/prism/node.rb#15578 + # source://prism//lib/prism/node.rb#13650 sig { returns(Integer) } def denominator; end @@ -27991,13 +25228,13 @@ class Prism::RationalNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15596 + # source://prism//lib/prism/node.rb#13638 sig { returns(T::Boolean) } def hexadecimal?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#15601 + # source://prism//lib/prism/node.rb#13653 sig { override.returns(String) } def inspect; end @@ -28005,66 +25242,40 @@ class Prism::RationalNode < ::Prism::Node # # 1.5r # numerator 3 # - # source://prism//lib/prism/node.rb#15573 + # source://prism//lib/prism/node.rb#13645 sig { returns(Integer) } def numerator; end # Returns the value of the node as an IntegerNode or a FloatNode. This # method is deprecated in favor of #value or #numerator/#denominator. # - # source://prism//lib/prism/node_ext.rb#114 + # source://prism//lib/prism/node_ext.rb#120 def numeric; end # def octal?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15591 + # source://prism//lib/prism/node.rb#13633 sig { returns(T::Boolean) } def octal?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#15619 + # source://prism//lib/prism/node.rb#13658 sig { override.returns(Symbol) } def type; end # Returns the value of the node as a Ruby Rational. # - # source://prism//lib/prism/node_ext.rb#108 + # source://prism//lib/prism/node_ext.rb#114 sig { returns(Rational) } def value; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#15567 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#15629 + # source://prism//lib/prism/node.rb#13663 def type; end end end @@ -28074,63 +25285,55 @@ end # redo # ^^^^ # -# source://prism//lib/prism/node.rb#15647 +# source://prism//lib/prism/node.rb#13681 class Prism::RedoNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new RedoNode node. # # @return [RedoNode] a new instance of RedoNode # - # source://prism//lib/prism/node.rb#15649 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#13683 + def initialize(source, node_id, location, flags); 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#15722 + # source://prism//lib/prism/node.rb#13740 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15655 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#13691 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15660 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13696 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15670 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#13706 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15665 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#13701 def compact_child_nodes; end - # def copy: (?location: Location) -> RedoNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode # - # source://prism//lib/prism/node.rb#15675 - sig { params(location: Prism::Location).returns(Prism::RedoNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#13711 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15660 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#13696 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#15683 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#13719 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -28138,38 +25341,20 @@ class Prism::RedoNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#15688 + # source://prism//lib/prism/node.rb#13724 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#15706 + # source://prism//lib/prism/node.rb#13729 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#15716 + # source://prism//lib/prism/node.rb#13734 def type; end end end @@ -28306,62 +25491,62 @@ class Prism::Reflection::StringField < ::Prism::Reflection::Field; end # Flags for regular expression and match last line nodes. # -# source://prism//lib/prism/node.rb#19214 +# source://prism//lib/prism/node.rb#16737 module Prism::RegularExpressionFlags; end # n - forces the ASCII-8BIT encoding # -# source://prism//lib/prism/node.rb#19231 +# source://prism//lib/prism/node.rb#16754 Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) # e - forces the EUC-JP encoding # -# source://prism//lib/prism/node.rb#19228 +# source://prism//lib/prism/node.rb#16751 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#19219 +# source://prism//lib/prism/node.rb#16742 Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) # internal bytes forced the encoding to binary # -# source://prism//lib/prism/node.rb#19243 +# source://prism//lib/prism/node.rb#16766 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#19246 +# source://prism//lib/prism/node.rb#16769 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#19240 +# source://prism//lib/prism/node.rb#16763 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#19216 +# source://prism//lib/prism/node.rb#16739 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#19222 +# source://prism//lib/prism/node.rb#16745 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#19225 +# source://prism//lib/prism/node.rb#16748 Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) # u - forces the UTF-8 encoding # -# source://prism//lib/prism/node.rb#19237 +# source://prism//lib/prism/node.rb#16760 Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) # s - forces the Windows-31J encoding # -# source://prism//lib/prism/node.rb#19234 +# source://prism//lib/prism/node.rb#16757 Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) # Represents a regular expression literal with no interpolation. @@ -28369,37 +25554,38 @@ Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) # /foo/i # ^^^^^^ # -# source://prism//lib/prism/node.rb#15731 +# source://prism//lib/prism/node.rb#13749 class Prism::RegularExpressionNode < ::Prism::Node include ::Prism::RegularExpressionOptions - # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void + # Initialize a new RegularExpressionNode node. # # @return [RegularExpressionNode] a new instance of RegularExpressionNode # - # source://prism//lib/prism/node.rb#15733 + # source://prism//lib/prism/node.rb#13751 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, content_loc: Prism::Location, closing_loc: Prism::Location, - unescaped: String, - location: Prism::Location + unescaped: String ).void end - def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); 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#15909 + # source://prism//lib/prism/node.rb#13906 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15744 + # source://prism//lib/prism/node.rb#13763 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -28407,77 +25593,78 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15830 + # source://prism//lib/prism/node.rb#13821 sig { returns(T::Boolean) } def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15749 + # source://prism//lib/prism/node.rb#13768 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#15870 + # source://prism//lib/prism/node.rb#13885 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#15795 + # source://prism//lib/prism/node.rb#13865 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15759 + # source://prism//lib/prism/node.rb#13778 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#15754 + # source://prism//lib/prism/node.rb#13773 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism//lib/prism/node.rb#15865 + # source://prism//lib/prism/node.rb#13880 sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//lib/prism/node.rb#15788 + # source://prism//lib/prism/node.rb#13858 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode # - # source://prism//lib/prism/node.rb#15764 + # source://prism//lib/prism/node.rb#13783 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, content_loc: Prism::Location, closing_loc: Prism::Location, - unescaped: String, - location: Prism::Location + unescaped: String ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15749 + # source://prism//lib/prism/node.rb#13768 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String } # - # source://prism//lib/prism/node.rb#15772 + # source://prism//lib/prism/node.rb#13791 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -28485,7 +25672,7 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15825 + # source://prism//lib/prism/node.rb#13816 sig { returns(T::Boolean) } def euc_jp?; end @@ -28493,7 +25680,7 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15810 + # source://prism//lib/prism/node.rb#13801 sig { returns(T::Boolean) } def extended?; end @@ -28504,7 +25691,7 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15850 + # source://prism//lib/prism/node.rb#13841 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -28512,7 +25699,7 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15855 + # source://prism//lib/prism/node.rb#13846 sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end @@ -28520,7 +25707,7 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15845 + # source://prism//lib/prism/node.rb#13836 sig { returns(T::Boolean) } def forced_utf8_encoding?; end @@ -28528,13 +25715,13 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15805 + # source://prism//lib/prism/node.rb#13796 sig { returns(T::Boolean) } def ignore_case?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#15875 + # source://prism//lib/prism/node.rb#13890 sig { override.returns(String) } def inspect; end @@ -28542,7 +25729,7 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15815 + # source://prism//lib/prism/node.rb#13806 sig { returns(T::Boolean) } def multi_line?; end @@ -28550,47 +25737,34 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15820 + # source://prism//lib/prism/node.rb#13811 sig { returns(T::Boolean) } def once?; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#15860 + # source://prism//lib/prism/node.rb#13875 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#15781 + # source://prism//lib/prism/node.rb#13851 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 - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#15893 + # source://prism//lib/prism/node.rb#13895 sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#15802 + # source://prism//lib/prism/node.rb#13872 sig { returns(String) } def unescaped; end @@ -28598,7 +25772,7 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15840 + # source://prism//lib/prism/node.rb#13831 sig { returns(T::Boolean) } def utf_8?; end @@ -28606,27 +25780,14 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15835 + # source://prism//lib/prism/node.rb#13826 sig { returns(T::Boolean) } def windows_31j?; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#15777 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#15903 + # source://prism//lib/prism/node.rb#13900 def type; end end end @@ -28646,77 +25807,79 @@ end # ^^ # end # -# source://prism//lib/prism/node.rb#15924 +# source://prism//lib/prism/node.rb#13921 class Prism::RequiredKeywordParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location name_loc, Location location) -> void + # Initialize a new RequiredKeywordParameterNode node. # # @return [RequiredKeywordParameterNode] a new instance of RequiredKeywordParameterNode # - # source://prism//lib/prism/node.rb#15926 + # source://prism//lib/prism/node.rb#13923 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, name: Symbol, - name_loc: Prism::Location, - location: Prism::Location + name_loc: Prism::Location ).void end - def initialize(source, flags, name, name_loc, location); end + def initialize(source, node_id, location, flags, name, name_loc); 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#16021 + # source://prism//lib/prism/node.rb#13997 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15935 + # source://prism//lib/prism/node.rb#13933 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#15940 + # source://prism//lib/prism/node.rb#13938 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#15950 + # source://prism//lib/prism/node.rb#13948 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#15945 + # source://prism//lib/prism/node.rb#13943 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?location: Location) -> RequiredKeywordParameterNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode # - # source://prism//lib/prism/node.rb#15955 + # source://prism//lib/prism/node.rb#13953 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, name: Symbol, - name_loc: Prism::Location, - location: Prism::Location + name_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15940 + # source://prism//lib/prism/node.rb#13938 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location } # - # source://prism//lib/prism/node.rb#15963 + # source://prism//lib/prism/node.rb#13961 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -28725,19 +25888,19 @@ class Prism::RequiredKeywordParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#15987 + # source://prism//lib/prism/node.rb#13981 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#15972 + # source://prism//lib/prism/node.rb#13971 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#15975 + # source://prism//lib/prism/node.rb#13974 sig { returns(Prism::Location) } def name_loc; end @@ -28745,46 +25908,20 @@ class Prism::RequiredKeywordParameterNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15982 + # source://prism//lib/prism/node.rb#13966 sig { returns(T::Boolean) } def repeated_parameter?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#16005 + # source://prism//lib/prism/node.rb#13986 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#15968 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#16015 + # source://prism//lib/prism/node.rb#13991 def type; end end end @@ -28795,62 +25932,69 @@ end # ^ # end # -# source://prism//lib/prism/node.rb#16034 +# source://prism//lib/prism/node.rb#14010 class Prism::RequiredParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location location) -> void + # Initialize a new RequiredParameterNode node. # # @return [RequiredParameterNode] a new instance of RequiredParameterNode # - # source://prism//lib/prism/node.rb#16036 - sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void } - def initialize(source, flags, name, location); end + # source://prism//lib/prism/node.rb#14012 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); 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#16123 + # source://prism//lib/prism/node.rb#14078 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16044 + # source://prism//lib/prism/node.rb#14021 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#16049 + # source://prism//lib/prism/node.rb#14026 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#16059 + # source://prism//lib/prism/node.rb#14036 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#16054 + # source://prism//lib/prism/node.rb#14031 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> RequiredParameterNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode # - # source://prism//lib/prism/node.rb#16064 - 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 + # source://prism//lib/prism/node.rb#14041 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::RequiredParameterNode) + end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16049 + # source://prism//lib/prism/node.rb#14026 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } # - # source://prism//lib/prism/node.rb#16072 + # source://prism//lib/prism/node.rb#14049 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -28859,13 +26003,13 @@ class Prism::RequiredParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#16089 + # source://prism//lib/prism/node.rb#14062 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#16081 + # source://prism//lib/prism/node.rb#14059 sig { returns(Symbol) } def name; end @@ -28873,46 +26017,20 @@ class Prism::RequiredParameterNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16084 + # source://prism//lib/prism/node.rb#14054 sig { returns(T::Boolean) } def repeated_parameter?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#16107 + # source://prism//lib/prism/node.rb#14067 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#16077 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#16117 + # source://prism//lib/prism/node.rb#14072 def type; end end end @@ -28922,84 +26040,60 @@ end # foo rescue nil # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#16134 +# source://prism//lib/prism/node.rb#14089 class Prism::RescueModifierNode < ::Prism::Node - # def initialize: (Prism::node expression, Location keyword_loc, Prism::node rescue_expression, Location location) -> void + # Initialize a new RescueModifierNode node. # # @return [RescueModifierNode] a new instance of RescueModifierNode # - # source://prism//lib/prism/node.rb#16136 - 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 + # source://prism//lib/prism/node.rb#14091 + def initialize(source, node_id, location, flags, expression, keyword_loc, rescue_expression); 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#16230 + # source://prism//lib/prism/node.rb#14169 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16145 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#14102 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16150 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14107 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16160 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#14117 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16155 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#14112 def compact_child_nodes; end - # def copy: (?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node, ?location: Location) -> RescueModifierNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode # - # source://prism//lib/prism/node.rb#16165 - 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 + # source://prism//lib/prism/node.rb#14122 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16150 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14107 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node } # - # source://prism//lib/prism/node.rb#16173 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#14130 def deconstruct_keys(keys); end # attr_reader expression: Prism::node # - # source://prism//lib/prism/node.rb#16178 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#14135 def expression; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -29007,59 +26101,38 @@ class Prism::RescueModifierNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#16196 + # source://prism//lib/prism/node.rb#14153 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#16191 - sig { returns(String) } + # source://prism//lib/prism/node.rb#14148 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#16181 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#14138 def keyword_loc; end # source://prism//lib/prism/parse_result/newlines.rb#115 - def newline!(lines); end + def newline_flag!(lines); end # attr_reader rescue_expression: Prism::node # - # source://prism//lib/prism/node.rb#16188 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#14145 def rescue_expression; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#16214 + # source://prism//lib/prism/node.rb#14158 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#16224 + # source://prism//lib/prism/node.rb#14163 def type; end end end @@ -29074,96 +26147,66 @@ end # # `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `exception` field. # -# source://prism//lib/prism/node.rb#16247 +# source://prism//lib/prism/node.rb#14186 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 + # Initialize a new RescueNode node. # # @return [RescueNode] a new instance of RescueNode # - # source://prism//lib/prism/node.rb#16249 - 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 + # source://prism//lib/prism/node.rb#14188 + def initialize(source, node_id, location, flags, keyword_loc, exceptions, operator_loc, reference, statements, subsequent); 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#16375 + # source://prism//lib/prism/node.rb#14298 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16261 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#14202 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16266 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14207 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16281 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#14222 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16271 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#14212 def compact_child_nodes; end - # attr_reader consequent: RescueNode? + # Returns the subsequent rescue clause of the rescue node. This method is + # deprecated in favor of #subsequent. # - # source://prism//lib/prism/node.rb#16328 - sig { returns(T.nilable(Prism::RescueNode)) } + # source://prism//lib/prism/node_ext.rb#494 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: Prism::node?, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode # - # source://prism//lib/prism/node.rb#16286 - 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 + # source://prism//lib/prism/node.rb#14227 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16266 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14207 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, exceptions: Array[Prism::node], operator_loc: Location?, reference: Prism::node?, statements: StatementsNode?, subsequent: RescueNode? } # - # source://prism//lib/prism/node.rb#16294 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#14235 def deconstruct_keys(keys); end # attr_reader exceptions: Array[Prism::node] # - # source://prism//lib/prism/node.rb#16306 - sig { returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#14247 def exceptions; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -29171,74 +26214,55 @@ class Prism::RescueNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#16341 + # source://prism//lib/prism/node.rb#14282 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#16331 - sig { returns(String) } + # source://prism//lib/prism/node.rb#14272 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#16299 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#14240 def keyword_loc; end # def operator: () -> String? # - # source://prism//lib/prism/node.rb#16336 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#14277 def operator; end # attr_reader operator_loc: Location? # - # source://prism//lib/prism/node.rb#16309 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#14250 def operator_loc; end # attr_reader reference: Prism::node? # - # source://prism//lib/prism/node.rb#16322 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#14263 def reference; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#16325 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#14266 def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # attr_reader subsequent: RescueNode? # - # def type: () -> Symbol + # source://prism//lib/prism/node.rb#14269 + def subsequent; end + + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#16359 + # source://prism//lib/prism/node.rb#14287 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#16369 + # source://prism//lib/prism/node.rb#14292 def type; end end end @@ -29249,79 +26273,81 @@ end # ^^ # end # -# source://prism//lib/prism/node.rb#16392 +# source://prism//lib/prism/node.rb#14315 class Prism::RestParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void + # Initialize a new RestParameterNode node. # # @return [RestParameterNode] a new instance of RestParameterNode # - # source://prism//lib/prism/node.rb#16394 + # source://prism//lib/prism/node.rb#14317 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: Prism::Location ).void end - def initialize(source, flags, name, name_loc, operator_loc, location); end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc); 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#16508 + # source://prism//lib/prism/node.rb#14410 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16404 + # source://prism//lib/prism/node.rb#14328 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#16409 + # source://prism//lib/prism/node.rb#14333 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#16419 + # source://prism//lib/prism/node.rb#14343 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#16414 + # source://prism//lib/prism/node.rb#14338 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode # - # source://prism//lib/prism/node.rb#16424 + # source://prism//lib/prism/node.rb#14348 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), - operator_loc: Prism::Location, - location: Prism::Location + operator_loc: 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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16409 + # source://prism//lib/prism/node.rb#14333 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location } # - # source://prism//lib/prism/node.rb#16432 + # source://prism//lib/prism/node.rb#14356 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -29330,31 +26356,31 @@ class Prism::RestParameterNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#16474 + # source://prism//lib/prism/node.rb#14394 sig { override.returns(String) } def inspect; end # attr_reader name: Symbol? # - # source://prism//lib/prism/node.rb#16441 + # source://prism//lib/prism/node.rb#14366 sig { returns(T.nilable(Symbol)) } def name; end # attr_reader name_loc: Location? # - # source://prism//lib/prism/node.rb#16444 + # source://prism//lib/prism/node.rb#14369 sig { returns(T.nilable(Prism::Location)) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#16469 + # source://prism//lib/prism/node.rb#14389 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#16457 + # source://prism//lib/prism/node.rb#14382 sig { returns(Prism::Location) } def operator_loc; end @@ -29362,46 +26388,20 @@ class Prism::RestParameterNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16464 + # source://prism//lib/prism/node.rb#14361 sig { returns(T::Boolean) } def repeated_parameter?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#16492 + # source://prism//lib/prism/node.rb#14399 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#16437 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#16502 + # source://prism//lib/prism/node.rb#14404 def type; end end end @@ -29410,13 +26410,13 @@ end # the requested structure, any comments that were encounters, and any errors # that were encountered. # -# source://prism//lib/prism/parse_result.rb#521 +# source://prism//lib/prism/parse_result.rb#530 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#543 + # source://prism//lib/prism/parse_result.rb#552 sig do params( comments: T::Array[Prism::Comment], @@ -29431,7 +26431,7 @@ class Prism::Result # The list of comments that were encountered during parsing. # - # source://prism//lib/prism/parse_result.rb#523 + # source://prism//lib/prism/parse_result.rb#532 sig { returns(T::Array[Prism::Comment]) } def comments; end @@ -29439,25 +26439,25 @@ class Prism::Result # 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#531 + # source://prism//lib/prism/parse_result.rb#540 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#553 + # source://prism//lib/prism/parse_result.rb#562 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#558 + # source://prism//lib/prism/parse_result.rb#567 sig { returns(Encoding) } def encoding; end # The list of errors that were generated during parsing. # - # source://prism//lib/prism/parse_result.rb#534 + # source://prism//lib/prism/parse_result.rb#543 sig { returns(T::Array[Prism::ParseError]) } def errors; end @@ -29466,19 +26466,19 @@ class Prism::Result # # @return [Boolean] # - # source://prism//lib/prism/parse_result.rb#570 + # source://prism//lib/prism/parse_result.rb#579 sig { returns(T::Boolean) } def failure?; end # The list of magic comments that were encountered during parsing. # - # source://prism//lib/prism/parse_result.rb#526 + # source://prism//lib/prism/parse_result.rb#535 sig { returns(T::Array[Prism::MagicComment]) } def magic_comments; end # A Source instance that represents the source code that was parsed. # - # source://prism//lib/prism/parse_result.rb#540 + # source://prism//lib/prism/parse_result.rb#549 sig { returns(Prism::Source) } def source; end @@ -29487,13 +26487,13 @@ class Prism::Result # # @return [Boolean] # - # source://prism//lib/prism/parse_result.rb#564 + # source://prism//lib/prism/parse_result.rb#573 sig { returns(T::Boolean) } def success?; end # The list of warnings that were generated during parsing. # - # source://prism//lib/prism/parse_result.rb#537 + # source://prism//lib/prism/parse_result.rb#546 sig { returns(T::Array[Prism::ParseWarning]) } def warnings; end end @@ -29503,63 +26503,55 @@ end # retry # ^^^^^ # -# source://prism//lib/prism/node.rb#16521 +# source://prism//lib/prism/node.rb#14423 class Prism::RetryNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new RetryNode node. # # @return [RetryNode] a new instance of RetryNode # - # source://prism//lib/prism/node.rb#16523 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#14425 + def initialize(source, node_id, location, flags); 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#16596 + # source://prism//lib/prism/node.rb#14482 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16529 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#14433 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16534 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14438 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16544 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#14448 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16539 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#14443 def compact_child_nodes; end - # def copy: (?location: Location) -> RetryNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode # - # source://prism//lib/prism/node.rb#16549 - sig { params(location: Prism::Location).returns(Prism::RetryNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#14453 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16534 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14438 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#16557 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#14461 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -29567,38 +26559,20 @@ class Prism::RetryNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#16562 + # source://prism//lib/prism/node.rb#14466 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#16580 + # source://prism//lib/prism/node.rb#14471 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#16590 + # source://prism//lib/prism/node.rb#14476 def type; end end end @@ -29608,227 +26582,149 @@ end # return 1 # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#16605 +# source://prism//lib/prism/node.rb#14491 class Prism::ReturnNode < ::Prism::Node - # def initialize: (Integer flags, Location keyword_loc, ArgumentsNode? arguments, Location location) -> void + # Initialize a new ReturnNode node. # # @return [ReturnNode] a new instance of ReturnNode # - # source://prism//lib/prism/node.rb#16607 - sig do - params( - source: Prism::Source, - flags: Integer, - keyword_loc: Prism::Location, - arguments: T.nilable(Prism::ArgumentsNode), - location: Prism::Location - ).void - end - def initialize(source, flags, keyword_loc, arguments, location); end + # source://prism//lib/prism/node.rb#14493 + def initialize(source, node_id, location, flags, keyword_loc, arguments); 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#16709 + # source://prism//lib/prism/node.rb#14569 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16616 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#14503 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#16662 - sig { returns(T.nilable(Prism::ArgumentsNode)) } + # source://prism//lib/prism/node.rb#14545 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16621 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14508 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16633 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#14520 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16626 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#14513 def compact_child_nodes; end - # def copy: (?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?, ?location: Location) -> ReturnNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode # - # source://prism//lib/prism/node.rb#16638 - sig do - params( - flags: Integer, - keyword_loc: Prism::Location, - arguments: T.nilable(Prism::ArgumentsNode), - location: Prism::Location - ).returns(Prism::ReturnNode) - end - def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#14525 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16621 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14508 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, arguments: ArgumentsNode?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, arguments: ArgumentsNode? } # - # source://prism//lib/prism/node.rb#16646 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#14533 def deconstruct_keys(keys); end - - sig { override.returns(T::Array[Prism::Reflection::Field]) } - def fields; end - - # def inspect -> String - # - # source://prism//lib/prism/node.rb#16675 - sig { override.returns(String) } - def inspect; end - - # def keyword: () -> String - # - # source://prism//lib/prism/node.rb#16670 - sig { returns(String) } - def keyword; end - - # attr_reader keyword_loc: Location - # - # source://prism//lib/prism/node.rb#16655 - sig { returns(Prism::Location) } - def keyword_loc; end - - # def redundant?: () -> bool - # - # @return [Boolean] - # - # source://prism//lib/prism/node.rb#16665 - sig { returns(T::Boolean) } - def redundant?; end - - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # def type: () -> Symbol + # source://prism//lib/prism/node.rb#14553 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String # - # source://prism//lib/prism/node.rb#16693 - sig { override.returns(Symbol) } - def type; end + # source://prism//lib/prism/node.rb#14548 + def keyword; end - protected + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#14538 + def keyword_loc; end - # protected attr_reader flags: Integer + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#16651 - sig { returns(Integer) } - def flags; end + # source://prism//lib/prism/node.rb#14558 + sig { override.returns(Symbol) } + def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#16703 + # source://prism//lib/prism/node.rb#14563 def type; end end end -# Flags for return nodes. -# -# source://prism//lib/prism/node.rb#19250 -module Prism::ReturnNodeFlags; end - -# a return statement that is redundant because it is the last statement in a method -# -# source://prism//lib/prism/node.rb#19252 -Prism::ReturnNodeFlags::REDUNDANT = T.let(T.unsafe(nil), Integer) - # Represents the `self` keyword. # # self # ^^^^ # -# source://prism//lib/prism/node.rb#16721 +# source://prism//lib/prism/node.rb#14580 class Prism::SelfNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new SelfNode node. # # @return [SelfNode] a new instance of SelfNode # - # source://prism//lib/prism/node.rb#16723 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#14582 + def initialize(source, node_id, location, flags); 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#16796 + # source://prism//lib/prism/node.rb#14639 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16729 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#14590 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16734 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14595 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16744 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#14605 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16739 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#14600 def compact_child_nodes; end - # def copy: (?location: Location) -> SelfNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SelfNode # - # source://prism//lib/prism/node.rb#16749 - sig { params(location: Prism::Location).returns(Prism::SelfNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#14610 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16734 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14595 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#16757 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#14618 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -29836,38 +26732,20 @@ class Prism::SelfNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#16762 + # source://prism//lib/prism/node.rb#14623 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#16780 + # source://prism//lib/prism/node.rb#14628 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#16790 + # source://prism//lib/prism/node.rb#14633 def type; end end end @@ -29934,22 +26812,22 @@ class Prism::Serialize::Loader # source://prism//lib/prism/serialize.rb#114 def load_line_offsets; end - # source://prism//lib/prism/serialize.rb#438 + # source://prism//lib/prism/serialize.rb#446 def load_metadata; end - # source://prism//lib/prism/serialize.rb#472 + # source://prism//lib/prism/serialize.rb#480 def load_nodes; end - # source://prism//lib/prism/serialize.rb#486 + # source://prism//lib/prism/serialize.rb#494 def load_result; end # source://prism//lib/prism/serialize.rb#110 def load_start_line; end - # source://prism//lib/prism/serialize.rb#447 + # source://prism//lib/prism/serialize.rb#455 def load_tokens; end - # source://prism//lib/prism/serialize.rb#460 + # source://prism//lib/prism/serialize.rb#468 def load_tokens_result; end # Returns the value of attribute serialized. @@ -29969,61 +26847,61 @@ class Prism::Serialize::Loader private - # source://prism//lib/prism/serialize.rb#572 + # source://prism//lib/prism/serialize.rb#580 def load_constant(index); end - # source://prism//lib/prism/serialize.rb#525 + # source://prism//lib/prism/serialize.rb#533 def load_double; end - # source://prism//lib/prism/serialize.rb#540 + # source://prism//lib/prism/serialize.rb#548 def load_embedded_string; end - # source://prism//lib/prism/serialize.rb#602 + # source://prism//lib/prism/serialize.rb#610 def load_error_level; end - # source://prism//lib/prism/serialize.rb#514 + # source://prism//lib/prism/serialize.rb#522 def load_integer; end - # source://prism//lib/prism/serialize.rb#556 + # source://prism//lib/prism/serialize.rb#564 def load_location; end - # source://prism//lib/prism/serialize.rb#560 + # source://prism//lib/prism/serialize.rb#568 def load_location_object; end - # source://prism//lib/prism/serialize.rb#631 + # source://prism//lib/prism/serialize.rb#639 def load_node; end - # source://prism//lib/prism/serialize.rb#597 + # source://prism//lib/prism/serialize.rb#605 def load_optional_constant; end - # source://prism//lib/prism/serialize.rb#564 + # source://prism//lib/prism/serialize.rb#572 def load_optional_location; end - # source://prism//lib/prism/serialize.rb#568 + # source://prism//lib/prism/serialize.rb#576 def load_optional_location_object; end - # source://prism//lib/prism/serialize.rb#533 + # source://prism//lib/prism/serialize.rb#541 def load_optional_node; end - # source://prism//lib/prism/serialize.rb#593 + # source://prism//lib/prism/serialize.rb#601 def load_required_constant; end - # source://prism//lib/prism/serialize.rb#544 + # source://prism//lib/prism/serialize.rb#552 def load_string; end - # source://prism//lib/prism/serialize.rb#529 + # source://prism//lib/prism/serialize.rb#537 def load_uint32; end - # source://prism//lib/prism/serialize.rb#509 + # source://prism//lib/prism/serialize.rb#517 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#495 + # source://prism//lib/prism/serialize.rb#503 def load_varuint; end - # source://prism//lib/prism/serialize.rb#617 + # source://prism//lib/prism/serialize.rb#625 def load_warning_level; end end @@ -30055,7 +26933,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#1863 +# source://prism//lib/prism/serialize.rb#1721 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. @@ -30063,75 +26941,77 @@ Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) # C = { a: 1 } # ^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#16806 +# source://prism//lib/prism/node.rb#14649 class Prism::ShareableConstantNode < ::Prism::Node - # def initialize: (Integer flags, ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode write, Location location) -> void + # Initialize a new ShareableConstantNode node. # # @return [ShareableConstantNode] a new instance of ShareableConstantNode # - # source://prism//lib/prism/node.rb#16808 + # source://prism//lib/prism/node.rb#14651 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, - write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode), - location: Prism::Location + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode) ).void end - def initialize(source, flags, write, location); end + def initialize(source, node_id, location, flags, write); 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#16905 + # source://prism//lib/prism/node.rb#14727 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16816 + # source://prism//lib/prism/node.rb#14660 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#16821 + # source://prism//lib/prism/node.rb#14665 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#16831 + # source://prism//lib/prism/node.rb#14675 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#16826 + # source://prism//lib/prism/node.rb#14670 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) -> ShareableConstantNode # - # source://prism//lib/prism/node.rb#16836 + # source://prism//lib/prism/node.rb#14680 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, - write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode), - location: Prism::Location + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode) ).returns(Prism::ShareableConstantNode) end - def copy(flags: T.unsafe(nil), write: T.unsafe(nil), location: T.unsafe(nil)); end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), write: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16821 + # source://prism//lib/prism/node.rb#14665 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode } # - # source://prism//lib/prism/node.rb#16844 + # source://prism//lib/prism/node.rb#14688 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -30139,7 +27019,7 @@ class Prism::ShareableConstantNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16866 + # source://prism//lib/prism/node.rb#14703 sig { returns(T::Boolean) } def experimental_copy?; end @@ -30147,7 +27027,7 @@ class Prism::ShareableConstantNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16861 + # source://prism//lib/prism/node.rb#14698 sig { returns(T::Boolean) } def experimental_everything?; end @@ -30156,7 +27036,7 @@ class Prism::ShareableConstantNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#16871 + # source://prism//lib/prism/node.rb#14711 sig { override.returns(String) } def inspect; end @@ -30164,76 +27044,50 @@ class Prism::ShareableConstantNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16856 + # source://prism//lib/prism/node.rb#14693 sig { returns(T::Boolean) } def literal?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#16889 + # source://prism//lib/prism/node.rb#14716 sig { override.returns(Symbol) } def type; end # The constant write that should be modified with the shareability state. # - # source://prism//lib/prism/node.rb#16853 + # source://prism//lib/prism/node.rb#14708 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 - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#16849 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#16899 + # source://prism//lib/prism/node.rb#14721 def type; end end end # Flags for shareable constant nodes. # -# source://prism//lib/prism/node.rb#19256 +# source://prism//lib/prism/node.rb#16773 module Prism::ShareableConstantNodeFlags; end # constant writes that should be modified with shareable constant value experimental copy # -# source://prism//lib/prism/node.rb#19264 +# source://prism//lib/prism/node.rb#16781 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#19261 +# source://prism//lib/prism/node.rb#16778 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#19258 +# source://prism//lib/prism/node.rb#16775 Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer) # Represents a singleton class declaration involving the `class` keyword. @@ -30241,120 +27095,85 @@ Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer) # class << self end # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#16916 +# source://prism//lib/prism/node.rb#14738 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 + # Initialize a new SingletonClassNode node. # # @return [SingletonClassNode] a new instance of SingletonClassNode # - # source://prism//lib/prism/node.rb#16918 - 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 + # source://prism//lib/prism/node.rb#14740 + def initialize(source, node_id, location, flags, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc); 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#17045 + # source://prism//lib/prism/node.rb#14851 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16930 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#14754 def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#16986 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#14810 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16935 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14759 def child_nodes; end # def class_keyword: () -> String # - # source://prism//lib/prism/node.rb#16996 - sig { returns(String) } + # source://prism//lib/prism/node.rb#14820 def class_keyword; end # attr_reader class_keyword_loc: Location # - # source://prism//lib/prism/node.rb#16969 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#14793 def class_keyword_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16948 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#14772 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16940 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#14764 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: Prism::node?, ?end_keyword_loc: Location) -> SingletonClassNode # - # source://prism//lib/prism/node.rb#16953 - 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 + # source://prism//lib/prism/node.rb#14777 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16935 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14759 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Prism::node, body: Prism::node?, end_keyword_loc: Location } # - # source://prism//lib/prism/node.rb#16961 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#14785 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#17006 - sig { returns(String) } + # source://prism//lib/prism/node.rb#14830 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#16989 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#14813 def end_keyword_loc; end # attr_reader expression: Prism::node # - # source://prism//lib/prism/node.rb#16983 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#14807 def expression; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -30362,56 +27181,35 @@ class Prism::SingletonClassNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#17011 + # source://prism//lib/prism/node.rb#14835 sig { override.returns(String) } def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#16966 - sig { returns(T::Array[Symbol]) } + # source://prism//lib/prism/node.rb#14790 def locals; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#17001 - sig { returns(String) } + # source://prism//lib/prism/node.rb#14825 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#16976 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#14800 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#17029 + # source://prism//lib/prism/node.rb#14840 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#17039 + # source://prism//lib/prism/node.rb#14845 def type; end end end @@ -30426,26 +27224,26 @@ class Prism::Source # # @return [Source] a new instance of Source # - # source://prism//lib/prism/parse_result.rb#26 + # source://prism//lib/prism/parse_result.rb#30 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#78 + # source://prism//lib/prism/parse_result.rb#82 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#73 + # source://prism//lib/prism/parse_result.rb#77 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#95 + # source://prism//lib/prism/parse_result.rb#104 sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } def code_units_column(byte_offset, encoding); end @@ -30456,71 +27254,71 @@ class Prism::Source # concept of code units that differs from the number of characters in other # encodings, it is not captured here. # - # source://prism//lib/prism/parse_result.rb#88 + # source://prism//lib/prism/parse_result.rb#92 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#68 + # source://prism//lib/prism/parse_result.rb#72 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#34 + # source://prism//lib/prism/parse_result.rb#38 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#51 + # source://prism//lib/prism/parse_result.rb#55 sig { params(byte_offset: Integer).returns(Integer) } def line(byte_offset); end # Returns the byte offset of the end of the line corresponding to the given # byte offset. # - # source://prism//lib/prism/parse_result.rb#63 + # source://prism//lib/prism/parse_result.rb#67 def line_end(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#57 + # source://prism//lib/prism/parse_result.rb#61 sig { params(byte_offset: Integer).returns(Integer) } def line_start(byte_offset); end # Returns the lines of the source code as an array of strings. # - # source://prism//lib/prism/parse_result.rb#39 + # source://prism//lib/prism/parse_result.rb#43 sig { returns(T::Array[String]) } def lines; end # The list of newline byte offsets in the source code. # - # source://prism//lib/prism/parse_result.rb#23 + # source://prism//lib/prism/parse_result.rb#27 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#45 + # source://prism//lib/prism/parse_result.rb#49 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#17 + # source://prism//lib/prism/parse_result.rb#21 sig { returns(String) } def source; end # The line number where this source starts. # - # source://prism//lib/prism/parse_result.rb#20 + # source://prism//lib/prism/parse_result.rb#24 sig { returns(Integer) } def start_line; end @@ -30529,7 +27327,7 @@ class Prism::Source # Binary search through the offsets to find the line number for the given # byte offset. # - # source://prism//lib/prism/parse_result.rb#103 + # source://prism//lib/prism/parse_result.rb#112 def find_line(byte_offset); end class << self @@ -30548,63 +27346,55 @@ end # __ENCODING__ # ^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#17061 +# source://prism//lib/prism/node.rb#14867 class Prism::SourceEncodingNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new SourceEncodingNode node. # # @return [SourceEncodingNode] a new instance of SourceEncodingNode # - # source://prism//lib/prism/node.rb#17063 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#14869 + def initialize(source, node_id, location, flags); 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#17136 + # source://prism//lib/prism/node.rb#14926 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17069 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#14877 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17074 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14882 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17084 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#14892 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17079 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#14887 def compact_child_nodes; end - # def copy: (?location: Location) -> SourceEncodingNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceEncodingNode # - # source://prism//lib/prism/node.rb#17089 - sig { params(location: Prism::Location).returns(Prism::SourceEncodingNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#14897 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17074 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#14882 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#17097 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#14905 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -30612,38 +27402,20 @@ class Prism::SourceEncodingNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#17102 + # source://prism//lib/prism/node.rb#14910 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#17120 + # source://prism//lib/prism/node.rb#14915 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#17130 + # source://prism//lib/prism/node.rb#14920 def type; end end end @@ -30653,62 +27425,77 @@ end # __FILE__ # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#17145 +# source://prism//lib/prism/node.rb#14935 class Prism::SourceFileNode < ::Prism::Node - # def initialize: (Integer flags, String filepath, Location location) -> void + # Initialize a new SourceFileNode node. # # @return [SourceFileNode] a new instance of SourceFileNode # - # source://prism//lib/prism/node.rb#17147 - sig { params(source: Prism::Source, flags: Integer, filepath: String, location: Prism::Location).void } - def initialize(source, flags, filepath, location); end + # source://prism//lib/prism/node.rb#14937 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + filepath: String + ).void + end + def initialize(source, node_id, location, flags, filepath); 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#17249 + # source://prism//lib/prism/node.rb#15018 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17155 + # source://prism//lib/prism/node.rb#14946 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#17160 + # source://prism//lib/prism/node.rb#14951 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#17170 + # source://prism//lib/prism/node.rb#14961 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#17165 + # source://prism//lib/prism/node.rb#14956 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (?flags: Integer, ?filepath: String, ?location: Location) -> SourceFileNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode # - # source://prism//lib/prism/node.rb#17175 - 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 + # source://prism//lib/prism/node.rb#14966 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + filepath: String + ).returns(Prism::SourceFileNode) + end + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), filepath: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17160 + # source://prism//lib/prism/node.rb#14951 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, filepath: String, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, filepath: String } # - # source://prism//lib/prism/node.rb#17183 + # source://prism//lib/prism/node.rb#14974 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -30717,7 +27504,7 @@ class Prism::SourceFileNode < ::Prism::Node # 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#17192 + # source://prism//lib/prism/node.rb#14999 sig { returns(String) } def filepath; end @@ -30725,7 +27512,7 @@ class Prism::SourceFileNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17200 + # source://prism//lib/prism/node.rb#14984 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -30733,7 +27520,7 @@ class Prism::SourceFileNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17195 + # source://prism//lib/prism/node.rb#14979 sig { returns(T::Boolean) } def forced_utf8_encoding?; end @@ -30741,13 +27528,13 @@ class Prism::SourceFileNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17205 + # source://prism//lib/prism/node.rb#14989 sig { returns(T::Boolean) } def frozen?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#17215 + # source://prism//lib/prism/node.rb#15002 sig { override.returns(String) } def inspect; end @@ -30755,46 +27542,20 @@ class Prism::SourceFileNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17210 + # source://prism//lib/prism/node.rb#14994 sig { returns(T::Boolean) } def mutable?; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#17233 + # source://prism//lib/prism/node.rb#15007 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#17188 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#17243 + # source://prism//lib/prism/node.rb#15012 def type; end end end @@ -30804,63 +27565,55 @@ end # __LINE__ # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#17260 +# source://prism//lib/prism/node.rb#15029 class Prism::SourceLineNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new SourceLineNode node. # # @return [SourceLineNode] a new instance of SourceLineNode # - # source://prism//lib/prism/node.rb#17262 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#15031 + def initialize(source, node_id, location, flags); 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#17335 + # source://prism//lib/prism/node.rb#15088 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17268 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#15039 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17273 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15044 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17283 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#15054 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17278 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#15049 def compact_child_nodes; end - # def copy: (?location: Location) -> SourceLineNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceLineNode # - # source://prism//lib/prism/node.rb#17288 - sig { params(location: Prism::Location).returns(Prism::SourceLineNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#15059 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17273 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15044 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#17296 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#15067 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -30868,38 +27621,20 @@ class Prism::SourceLineNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#17301 + # source://prism//lib/prism/node.rb#15072 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#17319 + # source://prism//lib/prism/node.rb#15077 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#17329 + # source://prism//lib/prism/node.rb#15082 def type; end end end @@ -30909,82 +27644,60 @@ end # [*a] # ^^ # -# source://prism//lib/prism/node.rb#17344 +# source://prism//lib/prism/node.rb#15097 class Prism::SplatNode < ::Prism::Node - # def initialize: (Location operator_loc, Prism::node? expression, Location location) -> void + # Initialize a new SplatNode node. # # @return [SplatNode] a new instance of SplatNode # - # source://prism//lib/prism/node.rb#17346 - 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 + # source://prism//lib/prism/node.rb#15099 + def initialize(source, node_id, location, flags, operator_loc, expression); 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#17438 + # source://prism//lib/prism/node.rb#15175 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17354 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#15109 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17359 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15114 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17371 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#15126 def comment_targets; end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//lib/prism/node.rb#17364 - 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#17376 - 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 compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15119 + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode + # + # source://prism//lib/prism/node.rb#15131 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17359 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15114 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, expression: Prism::node?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, expression: Prism::node? } # - # source://prism//lib/prism/node.rb#17384 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#15139 def deconstruct_keys(keys); end # attr_reader expression: Prism::node? # - # source://prism//lib/prism/node.rb#17396 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#15151 def expression; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -30992,50 +27705,30 @@ class Prism::SplatNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#17404 + # source://prism//lib/prism/node.rb#15159 sig { override.returns(String) } def inspect; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#17399 - sig { returns(String) } + # source://prism//lib/prism/node.rb#15154 def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#17389 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#15144 def operator_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#17422 + # source://prism//lib/prism/node.rb#15164 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#17432 + # source://prism//lib/prism/node.rb#15169 def type; end end end @@ -31045,69 +27738,60 @@ end # foo; bar; baz # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#17449 +# source://prism//lib/prism/node.rb#15186 class Prism::StatementsNode < ::Prism::Node - # def initialize: (Array[Prism::node] body, Location location) -> void + # Initialize a new StatementsNode node. # # @return [StatementsNode] a new instance of StatementsNode # - # source://prism//lib/prism/node.rb#17451 - sig { params(source: Prism::Source, body: T::Array[Prism::Node], location: Prism::Location).void } - def initialize(source, body, location); end + # source://prism//lib/prism/node.rb#15188 + def initialize(source, node_id, location, flags, body); 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#17528 + # source://prism//lib/prism/node.rb#15249 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17458 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#15197 def accept(visitor); end # attr_reader body: Array[Prism::node] # - # source://prism//lib/prism/node.rb#17491 - sig { returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#15230 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17463 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15202 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17473 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#15212 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17468 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#15207 def compact_child_nodes; end - # def copy: (?body: Array[Prism::node], ?location: Location) -> StatementsNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode # - # source://prism//lib/prism/node.rb#17478 - sig { params(body: T::Array[Prism::Node], location: Prism::Location).returns(Prism::StatementsNode) } - def copy(body: T.unsafe(nil), location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#15217 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17463 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15202 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { body: Array[Prism::node], location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, body: Array[Prism::node] } # - # source://prism//lib/prism/node.rb#17486 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#15225 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -31115,61 +27799,43 @@ class Prism::StatementsNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#17494 + # source://prism//lib/prism/node.rb#15233 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#17512 + # source://prism//lib/prism/node.rb#15238 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#17522 + # source://prism//lib/prism/node.rb#15243 def type; end end end # Flags for string nodes. # -# source://prism//lib/prism/node.rb#19268 +# source://prism//lib/prism/node.rb#16785 module Prism::StringFlags; end # internal bytes forced the encoding to binary # -# source://prism//lib/prism/node.rb#19273 +# source://prism//lib/prism/node.rb#16790 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#19270 +# source://prism//lib/prism/node.rb#16787 Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) -# source://prism//lib/prism/node.rb#19276 +# source://prism//lib/prism/node.rb#16793 Prism::StringFlags::FROZEN = T.let(T.unsafe(nil), Integer) -# source://prism//lib/prism/node.rb#19279 +# source://prism//lib/prism/node.rb#16796 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. @@ -31183,107 +27849,109 @@ Prism::StringFlags::MUTABLE = T.let(T.unsafe(nil), Integer) # "foo #{bar} baz" # ^^^^ ^^^^ # -# source://prism//lib/prism/node.rb#17545 +# source://prism//lib/prism/node.rb#15266 class Prism::StringNode < ::Prism::Node include ::Prism::HeredocQuery - # def initialize: (Integer flags, Location? opening_loc, Location content_loc, Location? closing_loc, String unescaped, Location location) -> void + # Initialize a new StringNode node. # # @return [StringNode] a new instance of StringNode # - # source://prism//lib/prism/node.rb#17547 + # source://prism//lib/prism/node.rb#15268 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: T.nilable(Prism::Location), content_loc: Prism::Location, closing_loc: T.nilable(Prism::Location), - unescaped: String, - location: Prism::Location + unescaped: String ).void end - def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); 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#17700 + # source://prism//lib/prism/node.rb#15400 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17558 + # source://prism//lib/prism/node.rb#15280 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#17563 + # source://prism//lib/prism/node.rb#15285 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#17661 + # source://prism//lib/prism/node.rb#15379 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#17615 + # source://prism//lib/prism/node.rb#15353 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17573 + # source://prism//lib/prism/node.rb#15295 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#17568 + # source://prism//lib/prism/node.rb#15290 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism//lib/prism/node.rb#17656 + # source://prism//lib/prism/node.rb#15374 sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//lib/prism/node.rb#17608 + # source://prism//lib/prism/node.rb#15346 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode # - # source://prism//lib/prism/node.rb#17578 + # source://prism//lib/prism/node.rb#15300 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: T.nilable(Prism::Location), content_loc: Prism::Location, closing_loc: T.nilable(Prism::Location), - unescaped: String, - location: Prism::Location + unescaped: String ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17563 + # source://prism//lib/prism/node.rb#15285 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String } # - # source://prism//lib/prism/node.rb#17586 + # source://prism//lib/prism/node.rb#15308 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -31294,7 +27962,7 @@ class Prism::StringNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17636 + # source://prism//lib/prism/node.rb#15318 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -31302,7 +27970,7 @@ class Prism::StringNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17631 + # source://prism//lib/prism/node.rb#15313 sig { returns(T::Boolean) } def forced_utf8_encoding?; end @@ -31310,7 +27978,7 @@ class Prism::StringNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17641 + # source://prism//lib/prism/node.rb#15323 sig { returns(T::Boolean) } def frozen?; end @@ -31319,7 +27987,7 @@ class Prism::StringNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#17666 + # source://prism//lib/prism/node.rb#15384 sig { override.returns(String) } def inspect; end @@ -31327,71 +27995,45 @@ class Prism::StringNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17646 + # source://prism//lib/prism/node.rb#15328 sig { returns(T::Boolean) } def mutable?; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#17651 + # source://prism//lib/prism/node.rb#15369 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#17595 + # source://prism//lib/prism/node.rb#15333 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#69 + # source://prism//lib/prism/node_ext.rb#72 sig { returns(Prism::InterpolatedStringNode) } def to_interpolated; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#17684 + # source://prism//lib/prism/node.rb#15389 sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#17628 + # source://prism//lib/prism/node.rb#15366 sig { returns(String) } def unescaped; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#17591 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#17694 + # source://prism//lib/prism/node.rb#15394 def type; end end end @@ -31404,94 +28046,65 @@ end # super foo, bar # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#17717 +# source://prism//lib/prism/node.rb#15417 class Prism::SuperNode < ::Prism::Node - # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Prism::node? block, Location location) -> void + # Initialize a new SuperNode node. # # @return [SuperNode] a new instance of SuperNode # - # source://prism//lib/prism/node.rb#17719 - 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 + # source://prism//lib/prism/node.rb#15419 + def initialize(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc, block); 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#17854 + # source://prism//lib/prism/node.rb#15538 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17730 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#15432 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#17786 - sig { returns(T.nilable(Prism::ArgumentsNode)) } + # source://prism//lib/prism/node.rb#15488 def arguments; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#17802 - sig { returns(T.nilable(Prism::Node)) } + # source://prism//lib/prism/node.rb#15504 def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17735 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15437 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17748 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#15450 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17740 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#15442 def compact_child_nodes; end - # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: Prism::node?, ?location: Location) -> SuperNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: Prism::node?) -> SuperNode # - # source://prism//lib/prism/node.rb#17753 - 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 + # source://prism//lib/prism/node.rb#15455 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17735 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15437 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: Prism::node? } # - # source://prism//lib/prism/node.rb#17761 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#15463 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -31499,96 +28112,72 @@ class Prism::SuperNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#17820 + # source://prism//lib/prism/node.rb#15522 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#17805 - sig { returns(String) } + # source://prism//lib/prism/node.rb#15507 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#17766 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#15468 def keyword_loc; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#17810 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#15512 def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#17773 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#15475 def lparen_loc; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#17815 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#15517 def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#17789 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#15491 def rparen_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#17838 + # source://prism//lib/prism/node.rb#15527 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#17848 + # source://prism//lib/prism/node.rb#15532 def type; end end end # Flags for symbol nodes. # -# source://prism//lib/prism/node.rb#19283 +# source://prism//lib/prism/node.rb#16800 module Prism::SymbolFlags; end # internal bytes forced the encoding to binary # -# source://prism//lib/prism/node.rb#19288 +# source://prism//lib/prism/node.rb#16805 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#19291 +# source://prism//lib/prism/node.rb#16808 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#19285 +# source://prism//lib/prism/node.rb#16802 Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # Represents a symbol literal or a symbol contained within a `%i` list. @@ -31599,93 +28188,95 @@ Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # %i[foo] # ^^^ # -# source://prism//lib/prism/node.rb#17871 +# source://prism//lib/prism/node.rb#15555 class Prism::SymbolNode < ::Prism::Node - # def initialize: (Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped, Location location) -> void + # Initialize a new SymbolNode node. # # @return [SymbolNode] a new instance of SymbolNode # - # source://prism//lib/prism/node.rb#17873 + # source://prism//lib/prism/node.rb#15557 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, 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 + unescaped: String ).void end - def initialize(source, flags, opening_loc, value_loc, closing_loc, unescaped, location); end + def initialize(source, node_id, location, flags, opening_loc, value_loc, closing_loc, unescaped); 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#18027 + # source://prism//lib/prism/node.rb#15690 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17884 + # source://prism//lib/prism/node.rb#15569 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#17889 + # source://prism//lib/prism/node.rb#15574 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#17988 + # source://prism//lib/prism/node.rb#15669 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#17947 + # source://prism//lib/prism/node.rb#15643 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17899 + # source://prism//lib/prism/node.rb#15584 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#17894 + # source://prism//lib/prism/node.rb#15579 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode # - # source://prism//lib/prism/node.rb#17904 + # source://prism//lib/prism/node.rb#15589 sig do params( + node_id: Integer, + location: Prism::Location, 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 + unescaped: String ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17889 + # source://prism//lib/prism/node.rb#15574 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String } # - # source://prism//lib/prism/node.rb#17912 + # source://prism//lib/prism/node.rb#15597 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -31696,7 +28287,7 @@ class Prism::SymbolNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17968 + # source://prism//lib/prism/node.rb#15607 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -31704,7 +28295,7 @@ class Prism::SymbolNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17973 + # source://prism//lib/prism/node.rb#15612 sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end @@ -31712,131 +28303,110 @@ class Prism::SymbolNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17963 + # source://prism//lib/prism/node.rb#15602 sig { returns(T::Boolean) } def forced_utf8_encoding?; end # def inspect -> String # - # source://prism//lib/prism/node.rb#17993 + # source://prism//lib/prism/node.rb#15674 sig { override.returns(String) } def inspect; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#17978 + # source://prism//lib/prism/node.rb#15659 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#17921 + # source://prism//lib/prism/node.rb#15617 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#18011 + # source://prism//lib/prism/node.rb#15679 sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#17960 + # source://prism//lib/prism/node.rb#15656 sig { returns(String) } def unescaped; end # def value: () -> String? # - # source://prism//lib/prism/node.rb#17983 + # source://prism//lib/prism/node.rb#15664 sig { returns(T.nilable(String)) } def value; end # attr_reader value_loc: Location? # - # source://prism//lib/prism/node.rb#17934 + # source://prism//lib/prism/node.rb#15630 sig { returns(T.nilable(Prism::Location)) } def value_loc; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#17917 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#18021 + # source://prism//lib/prism/node.rb#15684 def type; end end end # This represents a token from the Ruby source. # -# source://prism//lib/prism/parse_result.rb#645 +# source://prism//lib/prism/parse_result.rb#662 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#657 + # source://prism//lib/prism/parse_result.rb#674 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#692 + # source://prism//lib/prism/parse_result.rb#709 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#665 + # source://prism//lib/prism/parse_result.rb#682 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 token. + # + # source://prism//lib/prism/parse_result.rb#716 + def inspect; end + # A Location object representing the location of this token in the source. # - # source://prism//lib/prism/parse_result.rb#670 + # source://prism//lib/prism/parse_result.rb#687 sig { returns(Prism::Location) } def location; end # Implement the pretty print interface for Token. # - # source://prism//lib/prism/parse_result.rb#677 + # source://prism//lib/prism/parse_result.rb#694 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#651 + # source://prism//lib/prism/parse_result.rb#668 sig { returns(Symbol) } def type; end # A byteslice of the source that this token represents. # - # source://prism//lib/prism/parse_result.rb#654 + # source://prism//lib/prism/parse_result.rb#671 sig { returns(String) } def value; end @@ -31844,7 +28414,7 @@ class Prism::Token # The Source object that represents the source this token came from. # - # source://prism//lib/prism/parse_result.rb#647 + # source://prism//lib/prism/parse_result.rb#664 sig { returns(Prism::Source) } def source; end end @@ -35842,13 +32412,13 @@ class Prism::Translation::RubyParser # Parse the given source and translate it into the seattlerb/ruby_parser # gem's Sexp format. # - # source://prism//lib/prism/translation/ruby_parser.rb#1556 + # source://prism//lib/prism/translation/ruby_parser.rb#1592 def parse(source, filepath = T.unsafe(nil)); end # Parse the given file and translate it into the seattlerb/ruby_parser # gem's Sexp format. # - # source://prism//lib/prism/translation/ruby_parser.rb#1562 + # source://prism//lib/prism/translation/ruby_parser.rb#1598 def parse_file(filepath); end private @@ -35856,20 +32426,20 @@ class Prism::Translation::RubyParser # Translate the given parse result and filepath into the # seattlerb/ruby_parser gem's Sexp format. # - # source://prism//lib/prism/translation/ruby_parser.rb#1584 + # source://prism//lib/prism/translation/ruby_parser.rb#1620 def translate(result, filepath); end class << self # Parse the given source and translate it into the seattlerb/ruby_parser # gem's Sexp format. # - # source://prism//lib/prism/translation/ruby_parser.rb#1569 + # source://prism//lib/prism/translation/ruby_parser.rb#1605 def parse(source, filepath = T.unsafe(nil)); end # Parse the given file and translate it into the seattlerb/ruby_parser # gem's Sexp format. # - # source://prism//lib/prism/translation/ruby_parser.rb#1575 + # source://prism//lib/prism/translation/ruby_parser.rb#1611 def parse_file(filepath); end end end @@ -35931,25 +32501,25 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # foo(bar) # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#96 + # source://prism//lib/prism/translation/ruby_parser.rb#108 def visit_arguments_node(node); end # [] # ^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#63 + # source://prism//lib/prism/translation/ruby_parser.rb#75 def visit_array_node(node); end # foo => [bar] # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#73 + # source://prism//lib/prism/translation/ruby_parser.rb#85 def visit_array_pattern_node(node); end # { a: 1 } # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#102 + # source://prism//lib/prism/translation/ruby_parser.rb#114 def visit_assoc_node(node); end # def foo(**); bar(**); end @@ -35958,47 +32528,47 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # { **foo } # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#111 + # source://prism//lib/prism/translation/ruby_parser.rb#123 def visit_assoc_splat_node(node); end # $+ # ^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#121 + # source://prism//lib/prism/translation/ruby_parser.rb#133 def visit_back_reference_read_node(node); end # begin end # ^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#127 + # source://prism//lib/prism/translation/ruby_parser.rb#139 def visit_begin_node(node); end # foo(&bar) # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#160 + # source://prism//lib/prism/translation/ruby_parser.rb#172 def visit_block_argument_node(node); end # foo { |; bar| } # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#168 + # source://prism//lib/prism/translation/ruby_parser.rb#180 def visit_block_local_variable_node(node); end # A block on a keyword or method call. # - # source://prism//lib/prism/translation/ruby_parser.rb#173 + # source://prism//lib/prism/translation/ruby_parser.rb#185 def visit_block_node(node); end # def foo(&bar); end # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#179 + # source://prism//lib/prism/translation/ruby_parser.rb#191 def visit_block_parameter_node(node); end # A block's parameters. # - # source://prism//lib/prism/translation/ruby_parser.rb#184 + # source://prism//lib/prism/translation/ruby_parser.rb#196 def visit_block_parameters_node(node); end # break @@ -36007,13 +32577,13 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # break foo # ^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#224 + # source://prism//lib/prism/translation/ruby_parser.rb#236 def visit_break_node(node); end # foo.bar &&= baz # ^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#287 + # source://prism//lib/prism/translation/ruby_parser.rb#304 def visit_call_and_write_node(node); end # foo @@ -36025,79 +32595,79 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # foo.bar() {} # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#242 + # source://prism//lib/prism/translation/ruby_parser.rb#254 def visit_call_node(node); end # foo.bar += baz # ^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#277 + # source://prism//lib/prism/translation/ruby_parser.rb#294 def visit_call_operator_write_node(node); end # foo.bar ||= baz # ^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#297 + # source://prism//lib/prism/translation/ruby_parser.rb#314 def visit_call_or_write_node(node); end # foo.bar, = 1 # ^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#320 + # source://prism//lib/prism/translation/ruby_parser.rb#337 def visit_call_target_node(node); end # foo => bar => baz # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#326 + # source://prism//lib/prism/translation/ruby_parser.rb#343 def visit_capture_pattern_node(node); end # case foo; in bar; end # ^^^^^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#338 + # source://prism//lib/prism/translation/ruby_parser.rb#355 def visit_case_match_node(node); end # case foo; when bar; end # ^^^^^^^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#332 + # source://prism//lib/prism/translation/ruby_parser.rb#349 def visit_case_node(node); end # class Foo; end # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#344 + # source://prism//lib/prism/translation/ruby_parser.rb#361 def visit_class_node(node); end # @@foo &&= bar # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#385 + # source://prism//lib/prism/translation/ruby_parser.rb#402 def visit_class_variable_and_write_node(node); end # @@foo += bar # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#379 + # source://prism//lib/prism/translation/ruby_parser.rb#396 def visit_class_variable_operator_write_node(node); end # @@foo ||= bar # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#391 + # source://prism//lib/prism/translation/ruby_parser.rb#408 def visit_class_variable_or_write_node(node); end # @@foo # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#364 + # source://prism//lib/prism/translation/ruby_parser.rb#381 def visit_class_variable_read_node(node); end # @@foo, = bar # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#397 + # source://prism//lib/prism/translation/ruby_parser.rb#414 def visit_class_variable_target_node(node); end # @@foo = 1 @@ -36106,55 +32676,55 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # @@foo, @@bar = 1 # ^^^^^ ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#373 + # source://prism//lib/prism/translation/ruby_parser.rb#390 def visit_class_variable_write_node(node); end # Foo &&= bar # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#430 + # source://prism//lib/prism/translation/ruby_parser.rb#447 def visit_constant_and_write_node(node); end # Foo += bar # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#424 + # source://prism//lib/prism/translation/ruby_parser.rb#441 def visit_constant_operator_write_node(node); end # Foo ||= bar # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#436 + # source://prism//lib/prism/translation/ruby_parser.rb#453 def visit_constant_or_write_node(node); end # Foo::Bar &&= baz # ^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#473 + # source://prism//lib/prism/translation/ruby_parser.rb#490 def visit_constant_path_and_write_node(node); end # Foo::Bar # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#448 + # source://prism//lib/prism/translation/ruby_parser.rb#465 def visit_constant_path_node(node); end # Foo::Bar += baz # ^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#467 + # source://prism//lib/prism/translation/ruby_parser.rb#484 def visit_constant_path_operator_write_node(node); end # Foo::Bar ||= baz # ^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#479 + # source://prism//lib/prism/translation/ruby_parser.rb#496 def visit_constant_path_or_write_node(node); end # Foo::Bar, = baz # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#485 + # source://prism//lib/prism/translation/ruby_parser.rb#502 def visit_constant_path_target_node(node); end # Foo::Bar = 1 @@ -36163,19 +32733,19 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # Foo::Foo, Bar::Bar = 1 # ^^^^^^^^ ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#461 + # source://prism//lib/prism/translation/ruby_parser.rb#478 def visit_constant_path_write_node(node); end # Foo # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#409 + # source://prism//lib/prism/translation/ruby_parser.rb#426 def visit_constant_read_node(node); end # Foo, = bar # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#442 + # source://prism//lib/prism/translation/ruby_parser.rb#459 def visit_constant_target_node(node); end # Foo = 1 @@ -36184,7 +32754,7 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # Foo, Bar = 1 # ^^^ ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#418 + # source://prism//lib/prism/translation/ruby_parser.rb#435 def visit_constant_write_node(node); end # def foo; end @@ -36193,7 +32763,7 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # def self.foo; end # ^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#501 + # source://prism//lib/prism/translation/ruby_parser.rb#518 def visit_def_node(node); end # defined? a @@ -36202,73 +32772,73 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # defined?(a) # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#532 + # source://prism//lib/prism/translation/ruby_parser.rb#549 def visit_defined_node(node); end # if foo then bar else baz end # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#538 + # source://prism//lib/prism/translation/ruby_parser.rb#555 def visit_else_node(node); end # "foo #{bar}" # ^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#544 + # source://prism//lib/prism/translation/ruby_parser.rb#561 def visit_embedded_statements_node(node); end # "foo #@bar" # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#552 + # source://prism//lib/prism/translation/ruby_parser.rb#569 def visit_embedded_variable_node(node); end # begin; foo; ensure; bar; end # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#558 + # source://prism//lib/prism/translation/ruby_parser.rb#575 def visit_ensure_node(node); end # false # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#564 + # source://prism//lib/prism/translation/ruby_parser.rb#581 def visit_false_node(node); end # foo => [*, bar, *] # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#570 + # source://prism//lib/prism/translation/ruby_parser.rb#587 def visit_find_pattern_node(node); end # if foo .. bar; end # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#576 + # source://prism//lib/prism/translation/ruby_parser.rb#593 def visit_flip_flop_node(node); end # 1.0 # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#586 + # source://prism//lib/prism/translation/ruby_parser.rb#603 def visit_float_node(node); end # for foo in bar do end # ^^^^^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#592 + # source://prism//lib/prism/translation/ruby_parser.rb#609 def visit_for_node(node); end # def foo(...); bar(...); end # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#598 + # source://prism//lib/prism/translation/ruby_parser.rb#615 def visit_forwarding_arguments_node(node); end # def foo(...); end # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#604 + # source://prism//lib/prism/translation/ruby_parser.rb#621 def visit_forwarding_parameter_node(node); end # super @@ -36277,37 +32847,37 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # super {} # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#613 + # source://prism//lib/prism/translation/ruby_parser.rb#630 def visit_forwarding_super_node(node); end # $foo &&= bar # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#640 + # source://prism//lib/prism/translation/ruby_parser.rb#657 def visit_global_variable_and_write_node(node); end # $foo += bar # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#634 + # source://prism//lib/prism/translation/ruby_parser.rb#651 def visit_global_variable_operator_write_node(node); end # $foo ||= bar # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#646 + # source://prism//lib/prism/translation/ruby_parser.rb#663 def visit_global_variable_or_write_node(node); end # $foo # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#619 + # source://prism//lib/prism/translation/ruby_parser.rb#636 def visit_global_variable_read_node(node); end # $foo, = bar # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#652 + # source://prism//lib/prism/translation/ruby_parser.rb#669 def visit_global_variable_target_node(node); end # $foo = 1 @@ -36316,19 +32886,19 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # $foo, $bar = 1 # ^^^^ ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#628 + # source://prism//lib/prism/translation/ruby_parser.rb#645 def visit_global_variable_write_node(node); end # {} # ^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#658 + # source://prism//lib/prism/translation/ruby_parser.rb#675 def visit_hash_node(node); end # foo => {} # ^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#664 + # source://prism//lib/prism/translation/ruby_parser.rb#681 def visit_hash_pattern_node(node); end # if foo then bar end @@ -36340,80 +32910,80 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # foo ? bar : baz # ^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#685 + # source://prism//lib/prism/translation/ruby_parser.rb#702 def visit_if_node(node); end # 1i # - # source://prism//lib/prism/translation/ruby_parser.rb#690 + # source://prism//lib/prism/translation/ruby_parser.rb#707 def visit_imaginary_node(node); end # { foo: } # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#696 + # source://prism//lib/prism/translation/ruby_parser.rb#713 def visit_implicit_node(node); end # foo { |bar,| } # ^ # - # source://prism//lib/prism/translation/ruby_parser.rb#701 + # source://prism//lib/prism/translation/ruby_parser.rb#718 def visit_implicit_rest_node(node); end # case foo; in bar; end # ^^^^^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#706 + # source://prism//lib/prism/translation/ruby_parser.rb#723 def visit_in_node(node); end # foo[bar] &&= baz # ^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#732 + # source://prism//lib/prism/translation/ruby_parser.rb#749 def visit_index_and_write_node(node); end # foo[bar] += baz # ^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#719 + # source://prism//lib/prism/translation/ruby_parser.rb#736 def visit_index_operator_write_node(node); end # foo[bar] ||= baz # ^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#745 + # source://prism//lib/prism/translation/ruby_parser.rb#762 def visit_index_or_write_node(node); end # foo[bar], = 1 # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#758 + # source://prism//lib/prism/translation/ruby_parser.rb#775 def visit_index_target_node(node); end # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#788 + # source://prism//lib/prism/translation/ruby_parser.rb#805 def visit_instance_variable_and_write_node(node); end # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#782 + # source://prism//lib/prism/translation/ruby_parser.rb#799 def visit_instance_variable_operator_write_node(node); end # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#794 + # source://prism//lib/prism/translation/ruby_parser.rb#811 def visit_instance_variable_or_write_node(node); end # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#767 + # source://prism//lib/prism/translation/ruby_parser.rb#784 def visit_instance_variable_read_node(node); end # @foo, = bar # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#800 + # source://prism//lib/prism/translation/ruby_parser.rb#817 def visit_instance_variable_target_node(node); end # ^^^^^^^^ @@ -36421,55 +32991,55 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # @foo, @bar = 1 # ^^^^ ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#776 + # source://prism//lib/prism/translation/ruby_parser.rb#793 def visit_instance_variable_write_node(node); end # 1 # ^ # - # source://prism//lib/prism/translation/ruby_parser.rb#806 + # source://prism//lib/prism/translation/ruby_parser.rb#823 def visit_integer_node(node); end # if /foo #{bar}/ then end # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#812 + # source://prism//lib/prism/translation/ruby_parser.rb#829 def visit_interpolated_match_last_line_node(node); end # /foo #{bar}/ # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#829 + # source://prism//lib/prism/translation/ruby_parser.rb#846 def visit_interpolated_regular_expression_node(node); end # "foo #{bar}" # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#844 + # source://prism//lib/prism/translation/ruby_parser.rb#861 def visit_interpolated_string_node(node); end # :"foo #{bar}" # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#851 + # source://prism//lib/prism/translation/ruby_parser.rb#868 def visit_interpolated_symbol_node(node); end # `foo #{bar}` # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#858 + # source://prism//lib/prism/translation/ruby_parser.rb#875 def visit_interpolated_x_string_node(node); end # -> { it } # ^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#923 + # source://prism//lib/prism/translation/ruby_parser.rb#947 def visit_it_local_variable_read_node(node); end # foo(bar: baz) # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#929 + # source://prism//lib/prism/translation/ruby_parser.rb#953 def visit_keyword_hash_node(node); end # def foo(**bar); end @@ -36478,42 +33048,42 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # def foo(**); end # ^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#938 + # source://prism//lib/prism/translation/ruby_parser.rb#962 def visit_keyword_rest_parameter_node(node); end # -> {} # - # source://prism//lib/prism/translation/ruby_parser.rb#943 + # source://prism//lib/prism/translation/ruby_parser.rb#967 def visit_lambda_node(node); end # foo &&= bar # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#986 + # source://prism//lib/prism/translation/ruby_parser.rb#1010 def visit_local_variable_and_write_node(node); end # foo += bar # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#980 + # source://prism//lib/prism/translation/ruby_parser.rb#1004 def visit_local_variable_operator_write_node(node); end # foo ||= bar # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#992 + # source://prism//lib/prism/translation/ruby_parser.rb#1016 def visit_local_variable_or_write_node(node); end # foo # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#961 + # source://prism//lib/prism/translation/ruby_parser.rb#985 def visit_local_variable_read_node(node); end # foo, = bar # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#998 + # source://prism//lib/prism/translation/ruby_parser.rb#1022 def visit_local_variable_target_node(node); end # foo = 1 @@ -36522,56 +33092,56 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # foo, bar = 1 # ^^^ ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#974 + # source://prism//lib/prism/translation/ruby_parser.rb#998 def visit_local_variable_write_node(node); end # if /foo/ then end # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1004 + # source://prism//lib/prism/translation/ruby_parser.rb#1028 def visit_match_last_line_node(node); end # foo in bar # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1010 + # source://prism//lib/prism/translation/ruby_parser.rb#1034 def visit_match_predicate_node(node); end # foo => bar # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1016 + # source://prism//lib/prism/translation/ruby_parser.rb#1040 def visit_match_required_node(node); end # /(?foo)/ =~ bar # ^^^^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1022 + # source://prism//lib/prism/translation/ruby_parser.rb#1046 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/ruby_parser.rb#1029 + # source://prism//lib/prism/translation/ruby_parser.rb#1053 def visit_missing_node(node); end # module Foo; end # ^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1035 + # source://prism//lib/prism/translation/ruby_parser.rb#1059 def visit_module_node(node); end # foo, bar = baz # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1055 + # source://prism//lib/prism/translation/ruby_parser.rb#1079 def visit_multi_target_node(node); end # foo, bar = baz # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1065 + # source://prism//lib/prism/translation/ruby_parser.rb#1089 def visit_multi_write_node(node); end # next @@ -36580,55 +33150,55 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # next foo # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1089 + # source://prism//lib/prism/translation/ruby_parser.rb#1113 def visit_next_node(node); end # nil # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1102 + # source://prism//lib/prism/translation/ruby_parser.rb#1126 def visit_nil_node(node); end # def foo(**nil); end # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1108 + # source://prism//lib/prism/translation/ruby_parser.rb#1132 def visit_no_keywords_parameter_node(node); end # -> { _1 + _2 } # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1114 + # source://prism//lib/prism/translation/ruby_parser.rb#1138 def visit_numbered_parameters_node(node); end # $1 # ^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1120 + # source://prism//lib/prism/translation/ruby_parser.rb#1144 def visit_numbered_reference_read_node(node); end # def foo(bar: baz); end # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1126 + # source://prism//lib/prism/translation/ruby_parser.rb#1150 def visit_optional_keyword_parameter_node(node); end # def foo(bar = 1); end # ^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1132 + # source://prism//lib/prism/translation/ruby_parser.rb#1156 def visit_optional_parameter_node(node); end # a or b # ^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1138 + # source://prism//lib/prism/translation/ruby_parser.rb#1162 def visit_or_node(node); end # def foo(bar, *baz); end # ^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1144 + # source://prism//lib/prism/translation/ruby_parser.rb#1180 def visit_parameters_node(node); end # () @@ -36637,82 +33207,82 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # (1) # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1182 + # source://prism//lib/prism/translation/ruby_parser.rb#1218 def visit_parentheses_node(node); end # foo => ^(bar) # ^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1192 + # source://prism//lib/prism/translation/ruby_parser.rb#1228 def visit_pinned_expression_node(node); end # foo = 1 and bar => ^foo # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1198 + # source://prism//lib/prism/translation/ruby_parser.rb#1234 def visit_pinned_variable_node(node); end # END {} # - # source://prism//lib/prism/translation/ruby_parser.rb#1207 + # source://prism//lib/prism/translation/ruby_parser.rb#1243 def visit_post_execution_node(node); end # BEGIN {} # - # source://prism//lib/prism/translation/ruby_parser.rb#1212 + # source://prism//lib/prism/translation/ruby_parser.rb#1248 def visit_pre_execution_node(node); end # The top-level program node. # - # source://prism//lib/prism/translation/ruby_parser.rb#1217 + # source://prism//lib/prism/translation/ruby_parser.rb#1253 def visit_program_node(node); end # 0..5 # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1223 + # source://prism//lib/prism/translation/ruby_parser.rb#1259 def visit_range_node(node); end # 1r # ^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1245 + # source://prism//lib/prism/translation/ruby_parser.rb#1281 def visit_rational_node(node); end # redo # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1251 + # source://prism//lib/prism/translation/ruby_parser.rb#1287 def visit_redo_node(node); end # /foo/ # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1257 + # source://prism//lib/prism/translation/ruby_parser.rb#1293 def visit_regular_expression_node(node); end # def foo(bar:); end # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1263 + # source://prism//lib/prism/translation/ruby_parser.rb#1299 def visit_required_keyword_parameter_node(node); end # def foo(bar); end # ^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1269 + # source://prism//lib/prism/translation/ruby_parser.rb#1305 def visit_required_parameter_node(node); end # foo rescue bar # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1275 + # source://prism//lib/prism/translation/ruby_parser.rb#1311 def visit_rescue_modifier_node(node); end # begin; rescue; end # ^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1281 + # source://prism//lib/prism/translation/ruby_parser.rb#1317 def visit_rescue_node(node); end # def foo(*bar); end @@ -36721,13 +33291,13 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # def foo(*); end # ^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1301 + # source://prism//lib/prism/translation/ruby_parser.rb#1337 def visit_rest_parameter_node(node); end # retry # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1307 + # source://prism//lib/prism/translation/ruby_parser.rb#1343 def visit_retry_node(node); end # return @@ -36736,42 +33306,42 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # return 1 # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1316 + # source://prism//lib/prism/translation/ruby_parser.rb#1352 def visit_return_node(node); end # self # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1329 + # source://prism//lib/prism/translation/ruby_parser.rb#1365 def visit_self_node(node); end # A shareable constant. # - # source://prism//lib/prism/translation/ruby_parser.rb#1334 + # source://prism//lib/prism/translation/ruby_parser.rb#1370 def visit_shareable_constant_node(node); end # class << self; end # ^^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1340 + # source://prism//lib/prism/translation/ruby_parser.rb#1376 def visit_singleton_class_node(node); end # __ENCODING__ # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1348 + # source://prism//lib/prism/translation/ruby_parser.rb#1384 def visit_source_encoding_node(node); end # __FILE__ # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1355 + # source://prism//lib/prism/translation/ruby_parser.rb#1391 def visit_source_file_node(node); end # __LINE__ # ^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1361 + # source://prism//lib/prism/translation/ruby_parser.rb#1397 def visit_source_line_node(node); end # foo(*bar) @@ -36783,42 +33353,42 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # def foo(*); bar(*); end # ^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1373 + # source://prism//lib/prism/translation/ruby_parser.rb#1409 def visit_splat_node(node); end # A list of statements. # - # source://prism//lib/prism/translation/ruby_parser.rb#1382 + # source://prism//lib/prism/translation/ruby_parser.rb#1418 def visit_statements_node(node); end # "foo" # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1394 + # source://prism//lib/prism/translation/ruby_parser.rb#1430 def visit_string_node(node); end # super(foo) # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1400 + # source://prism//lib/prism/translation/ruby_parser.rb#1436 def visit_super_node(node); end # :foo # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1414 + # source://prism//lib/prism/translation/ruby_parser.rb#1450 def visit_symbol_node(node); end # true # ^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1420 + # source://prism//lib/prism/translation/ruby_parser.rb#1456 def visit_true_node(node); end # undef foo # ^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1426 + # source://prism//lib/prism/translation/ruby_parser.rb#1462 def visit_undef_node(node); end # unless foo; bar end @@ -36827,7 +33397,7 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # bar unless foo # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1436 + # source://prism//lib/prism/translation/ruby_parser.rb#1472 def visit_unless_node(node); end # until foo; bar end @@ -36836,13 +33406,13 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # bar until foo # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1445 + # source://prism//lib/prism/translation/ruby_parser.rb#1481 def visit_until_node(node); end # case foo; when bar; end # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1451 + # source://prism//lib/prism/translation/ruby_parser.rb#1487 def visit_when_node(node); end # while foo; bar end @@ -36851,13 +33421,13 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # bar while foo # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1460 + # source://prism//lib/prism/translation/ruby_parser.rb#1496 def visit_while_node(node); end # `foo` # ^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1466 + # source://prism//lib/prism/translation/ruby_parser.rb#1502 def visit_x_string_node(node); end # yield @@ -36866,7 +33436,7 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # yield 1 # ^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1482 + # source://prism//lib/prism/translation/ruby_parser.rb#1518 def visit_yield_node(node); end private @@ -36874,12 +33444,12 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # If a class variable is written within a method definition, it has a # different type than everywhere else. # - # source://prism//lib/prism/translation/ruby_parser.rb#403 + # source://prism//lib/prism/translation/ruby_parser.rb#420 def class_variable_write_type; end # Create a new compiler with the given options. # - # source://prism//lib/prism/translation/ruby_parser.rb#1489 + # source://prism//lib/prism/translation/ruby_parser.rb#1525 def copy_compiler(in_def: T.unsafe(nil), in_pattern: T.unsafe(nil)); end # Call nodes with operators following them will either be op_asgn or @@ -36888,53 +33458,53 @@ class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler # # @return [Boolean] # - # source://prism//lib/prism/translation/ruby_parser.rb#308 + # source://prism//lib/prism/translation/ruby_parser.rb#325 def op_asgn?(node); end # Call nodes with operators following them can use &. as an operator, # which changes their type by prefixing "safe_". # - # source://prism//lib/prism/translation/ruby_parser.rb#314 + # source://prism//lib/prism/translation/ruby_parser.rb#331 def op_asgn_type(node, type); end # Create a new Sexp object from the given prism node and arguments. # - # source://prism//lib/prism/translation/ruby_parser.rb#1494 + # source://prism//lib/prism/translation/ruby_parser.rb#1530 def s(node, *arguments); end # Visit a block node, which will modify the AST by wrapping the given # visited node in an iter node. # - # source://prism//lib/prism/translation/ruby_parser.rb#1504 + # source://prism//lib/prism/translation/ruby_parser.rb#1540 def visit_block(node, sexp, block); end # def foo((bar, baz)); end # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/ruby_parser.rb#1159 + # source://prism//lib/prism/translation/ruby_parser.rb#1195 def visit_destructured_parameter(node); end # Visit the interpolated content of the string-like node. # - # source://prism//lib/prism/translation/ruby_parser.rb#865 + # source://prism//lib/prism/translation/ruby_parser.rb#882 def visit_interpolated_parts(parts); end # Pattern constants get wrapped in another layer of :const. # - # source://prism//lib/prism/translation/ruby_parser.rb#1525 + # source://prism//lib/prism/translation/ruby_parser.rb#1561 def visit_pattern_constant(node); end # If the bounds of a range node are empty parentheses, then they do not # get replaced by their usual s(:nil), but instead are s(:begin). # - # source://prism//lib/prism/translation/ruby_parser.rb#1235 + # source://prism//lib/prism/translation/ruby_parser.rb#1271 def visit_range_bounds_node(node); end # Visit the value of a write, which will be on the right-hand side of # a write operator. Because implicit arrays can have splats, those could # potentially be wrapped in an svalue node. # - # source://prism//lib/prism/translation/ruby_parser.rb#1539 + # source://prism//lib/prism/translation/ruby_parser.rb#1575 def visit_write_value(node); end end @@ -36943,63 +33513,55 @@ end # true # ^^^^ # -# source://prism//lib/prism/node.rb#18041 +# source://prism//lib/prism/node.rb#15704 class Prism::TrueNode < ::Prism::Node - # def initialize: (Location location) -> void + # Initialize a new TrueNode node. # # @return [TrueNode] a new instance of TrueNode # - # source://prism//lib/prism/node.rb#18043 - sig { params(source: Prism::Source, location: Prism::Location).void } - def initialize(source, location); end + # source://prism//lib/prism/node.rb#15706 + def initialize(source, node_id, location, flags); 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#18116 + # source://prism//lib/prism/node.rb#15763 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18049 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#15714 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18054 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15719 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18064 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#15729 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18059 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#15724 def compact_child_nodes; end - # def copy: (?location: Location) -> TrueNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> TrueNode # - # source://prism//lib/prism/node.rb#18069 - sig { params(location: Prism::Location).returns(Prism::TrueNode) } - def copy(location: T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#15734 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18054 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15719 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } # - # source://prism//lib/prism/node.rb#18077 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#15742 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -37007,38 +33569,20 @@ class Prism::TrueNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#18082 + # source://prism//lib/prism/node.rb#15747 sig { override.returns(String) } def inspect; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#18100 + # source://prism//lib/prism/node.rb#15752 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#18110 + # source://prism//lib/prism/node.rb#15757 def type; end end end @@ -37048,76 +33592,55 @@ end # undef :foo, :bar, :baz # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#18125 +# source://prism//lib/prism/node.rb#15772 class Prism::UndefNode < ::Prism::Node - # def initialize: (Array[SymbolNode | InterpolatedSymbolNode] names, Location keyword_loc, Location location) -> void + # Initialize a new UndefNode node. # # @return [UndefNode] a new instance of UndefNode # - # source://prism//lib/prism/node.rb#18127 - 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 + # source://prism//lib/prism/node.rb#15774 + def initialize(source, node_id, location, flags, names, keyword_loc); 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#18217 + # source://prism//lib/prism/node.rb#15848 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18135 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#15784 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18140 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15789 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18150 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#15799 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18145 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#15794 def compact_child_nodes; end - # def copy: (?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location, ?location: Location) -> UndefNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode # - # source://prism//lib/prism/node.rb#18155 - 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 + # source://prism//lib/prism/node.rb#15804 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), names: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18140 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15789 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location } # - # source://prism//lib/prism/node.rb#18163 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#15812 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -37125,56 +33648,35 @@ class Prism::UndefNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#18183 + # source://prism//lib/prism/node.rb#15832 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18178 - sig { returns(String) } + # source://prism//lib/prism/node.rb#15827 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#18171 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#15820 def keyword_loc; end # attr_reader names: Array[SymbolNode | InterpolatedSymbolNode] # - # source://prism//lib/prism/node.rb#18168 - sig { returns(T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)]) } + # source://prism//lib/prism/node.rb#15817 def names; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#18201 + # source://prism//lib/prism/node.rb#15837 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#18211 + # source://prism//lib/prism/node.rb#15842 def type; end end end @@ -37187,99 +33689,74 @@ end # unless foo then bar end # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#18232 +# source://prism//lib/prism/node.rb#15863 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 + # Initialize a new UnlessNode node. # # @return [UnlessNode] a new instance of UnlessNode # - # source://prism//lib/prism/node.rb#18234 - 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 + # source://prism//lib/prism/node.rb#15865 + def initialize(source, node_id, location, flags, keyword_loc, predicate, then_keyword_loc, statements, else_clause, end_keyword_loc); 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#18399 + # source://prism//lib/prism/node.rb#16014 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18246 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#15879 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18251 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15884 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18265 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#15898 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18256 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#15889 def compact_child_nodes; end - # The else clause of the unless expression, if present. + # Returns the else clause of the unless node. This method is deprecated in + # favor of #else_clause. # - # unless cond then bar else baz end - # ^^^^^^^^ - # - # source://prism//lib/prism/node.rb#18331 - sig { returns(T.nilable(Prism::ElseNode)) } + # source://prism//lib/prism/node_ext.rb#503 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode # - # source://prism//lib/prism/node.rb#18270 - 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 + # source://prism//lib/prism/node.rb#15903 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), else_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18251 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#15884 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, else_clause: ElseNode?, end_keyword_loc: Location? } # - # source://prism//lib/prism/node.rb#18278 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#15911 def deconstruct_keys(keys); end + # The else clause of the unless expression, if present. + # + # unless cond then bar else baz end + # ^^^^^^^^ + # + # source://prism//lib/prism/node.rb#15964 + def else_clause; end + # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#18360 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#15993 def end_keyword; end # The location of the `end` keyword, if present. @@ -37287,8 +33764,7 @@ class Prism::UnlessNode < ::Prism::Node # unless cond then bar end # ^^^ # - # source://prism//lib/prism/node.rb#18337 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#15970 def end_keyword_loc; end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -37296,14 +33772,13 @@ class Prism::UnlessNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#18365 + # source://prism//lib/prism/node.rb#15998 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18350 - sig { returns(String) } + # source://prism//lib/prism/node.rb#15983 def keyword; end # The location of the `unless` keyword. @@ -37314,12 +33789,11 @@ class Prism::UnlessNode < ::Prism::Node # bar unless cond # ^^^^^^ # - # source://prism//lib/prism/node.rb#18289 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#15922 def keyword_loc; end # source://prism//lib/prism/parse_result/newlines.rb#97 - def newline!(lines); end + def newline_flag!(lines); end # The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). # @@ -37329,8 +33803,7 @@ class Prism::UnlessNode < ::Prism::Node # bar unless cond # ^^^^ # - # source://prism//lib/prism/node.rb#18302 - sig { returns(Prism::Node) } + # source://prism//lib/prism/node.rb#15935 def predicate; end # The body of statements that will executed if the unless condition is @@ -37339,14 +33812,12 @@ class Prism::UnlessNode < ::Prism::Node # unless cond then bar end # ^^^ # - # source://prism//lib/prism/node.rb#18325 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#15958 def statements; end # def then_keyword: () -> String? # - # source://prism//lib/prism/node.rb#18355 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#15988 def then_keyword; end # The location of the `then` keyword, if present. @@ -37354,38 +33825,19 @@ class Prism::UnlessNode < ::Prism::Node # unless cond then bar end # ^^^^ # - # source://prism//lib/prism/node.rb#18308 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#15941 def then_keyword_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#18383 + # source://prism//lib/prism/node.rb#16003 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#18393 + # source://prism//lib/prism/node.rb#16008 def type; end end end @@ -37398,35 +33850,36 @@ end # until foo do bar end # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#18417 +# source://prism//lib/prism/node.rb#16032 class Prism::UntilNode < ::Prism::Node - # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void + # Initialize a new UntilNode node. # # @return [UntilNode] a new instance of UntilNode # - # source://prism//lib/prism/node.rb#18419 + # source://prism//lib/prism/node.rb#16034 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, keyword_loc: Prism::Location, closing_loc: T.nilable(Prism::Location), predicate: Prism::Node, - statements: T.nilable(Prism::StatementsNode), - location: Prism::Location + statements: T.nilable(Prism::StatementsNode) ).void end - def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end + def initialize(source, node_id, location, flags, keyword_loc, closing_loc, predicate, statements); 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#18545 + # source://prism//lib/prism/node.rb#16139 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18430 + # source://prism//lib/prism/node.rb#16046 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -37434,65 +33887,66 @@ class Prism::UntilNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#18496 + # source://prism//lib/prism/node.rb#16082 sig { returns(T::Boolean) } def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18435 + # source://prism//lib/prism/node.rb#16051 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#18506 + # source://prism//lib/prism/node.rb#16118 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#18477 + # source://prism//lib/prism/node.rb#16094 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18448 + # source://prism//lib/prism/node.rb#16064 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#18440 + # source://prism//lib/prism/node.rb#16056 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode # - # source://prism//lib/prism/node.rb#18453 + # source://prism//lib/prism/node.rb#16069 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, keyword_loc: Prism::Location, closing_loc: T.nilable(Prism::Location), predicate: Prism::Node, - statements: T.nilable(Prism::StatementsNode), - location: Prism::Location + statements: T.nilable(Prism::StatementsNode) ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18435 + # source://prism//lib/prism/node.rb#16051 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? } # - # source://prism//lib/prism/node.rb#18461 + # source://prism//lib/prism/node.rb#16077 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -37501,73 +33955,47 @@ class Prism::UntilNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#18511 + # source://prism//lib/prism/node.rb#16123 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18501 + # source://prism//lib/prism/node.rb#16113 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#18470 + # source://prism//lib/prism/node.rb#16087 sig { returns(Prism::Location) } def keyword_loc; end # source://prism//lib/prism/parse_result/newlines.rb#103 - def newline!(lines); end + def newline_flag!(lines); end # attr_reader predicate: Prism::node # - # source://prism//lib/prism/node.rb#18490 + # source://prism//lib/prism/node.rb#16107 sig { returns(Prism::Node) } def predicate; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#18493 + # source://prism//lib/prism/node.rb#16110 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#18529 + # source://prism//lib/prism/node.rb#16128 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#18466 - 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. + # Return a symbol representation of this node type. See `Node::type`. # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#18539 + # source://prism//lib/prism/node.rb#16133 def type; end end end @@ -38510,86 +34938,60 @@ end # ^^^^^^^^^ # end # -# source://prism//lib/prism/node.rb#18561 +# source://prism//lib/prism/node.rb#16155 class Prism::WhenNode < ::Prism::Node - # def initialize: (Location keyword_loc, Array[Prism::node] conditions, Location? then_keyword_loc, StatementsNode? statements, Location location) -> void + # Initialize a new WhenNode node. # # @return [WhenNode] a new instance of WhenNode # - # source://prism//lib/prism/node.rb#18563 - 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 + # source://prism//lib/prism/node.rb#16157 + def initialize(source, node_id, location, flags, keyword_loc, conditions, then_keyword_loc, statements); 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#18679 + # source://prism//lib/prism/node.rb#16257 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18573 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#16169 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18578 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#16174 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18591 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#16187 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18583 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#16179 def compact_child_nodes; end # attr_reader conditions: Array[Prism::node] # - # source://prism//lib/prism/node.rb#18616 - sig { returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#16212 def conditions; end - # def copy: (?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?location: Location) -> WhenNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode # - # source://prism//lib/prism/node.rb#18596 - 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 + # source://prism//lib/prism/node.rb#16192 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18578 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#16174 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode? } # - # source://prism//lib/prism/node.rb#18604 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#16200 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -38597,68 +34999,45 @@ class Prism::WhenNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#18645 + # source://prism//lib/prism/node.rb#16241 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18635 - sig { returns(String) } + # source://prism//lib/prism/node.rb#16231 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#18609 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#16205 def keyword_loc; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#18632 - sig { returns(T.nilable(Prism::StatementsNode)) } + # source://prism//lib/prism/node.rb#16228 def statements; end # def then_keyword: () -> String? # - # source://prism//lib/prism/node.rb#18640 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#16236 def then_keyword; end # attr_reader then_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#18619 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#16215 def then_keyword_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#18663 + # source://prism//lib/prism/node.rb#16246 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#18673 + # source://prism//lib/prism/node.rb#16251 def type; end end end @@ -38671,35 +35050,36 @@ end # while foo do bar end # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#18696 +# source://prism//lib/prism/node.rb#16274 class Prism::WhileNode < ::Prism::Node - # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void + # Initialize a new WhileNode node. # # @return [WhileNode] a new instance of WhileNode # - # source://prism//lib/prism/node.rb#18698 + # source://prism//lib/prism/node.rb#16276 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, keyword_loc: Prism::Location, closing_loc: T.nilable(Prism::Location), predicate: Prism::Node, - statements: T.nilable(Prism::StatementsNode), - location: Prism::Location + statements: T.nilable(Prism::StatementsNode) ).void end - def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end + def initialize(source, node_id, location, flags, keyword_loc, closing_loc, predicate, statements); 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#18824 + # source://prism//lib/prism/node.rb#16381 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18709 + # source://prism//lib/prism/node.rb#16288 sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end @@ -38707,65 +35087,66 @@ class Prism::WhileNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#18775 + # source://prism//lib/prism/node.rb#16324 sig { returns(T::Boolean) } def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18714 + # source://prism//lib/prism/node.rb#16293 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#18785 + # source://prism//lib/prism/node.rb#16360 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#18756 + # source://prism//lib/prism/node.rb#16336 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18727 + # source://prism//lib/prism/node.rb#16306 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#18719 + # source://prism//lib/prism/node.rb#16298 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode # - # source://prism//lib/prism/node.rb#18732 + # source://prism//lib/prism/node.rb#16311 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, keyword_loc: Prism::Location, closing_loc: T.nilable(Prism::Location), predicate: Prism::Node, - statements: T.nilable(Prism::StatementsNode), - location: Prism::Location + statements: T.nilable(Prism::StatementsNode) ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18714 + # source://prism//lib/prism/node.rb#16293 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? } # - # source://prism//lib/prism/node.rb#18740 + # source://prism//lib/prism/node.rb#16319 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -38774,73 +35155,47 @@ class Prism::WhileNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#18790 + # source://prism//lib/prism/node.rb#16365 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18780 + # source://prism//lib/prism/node.rb#16355 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#18749 + # source://prism//lib/prism/node.rb#16329 sig { returns(Prism::Location) } def keyword_loc; end # source://prism//lib/prism/parse_result/newlines.rb#109 - def newline!(lines); end + def newline_flag!(lines); end # attr_reader predicate: Prism::node # - # source://prism//lib/prism/node.rb#18769 + # source://prism//lib/prism/node.rb#16349 sig { returns(Prism::Node) } def predicate; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#18772 + # source://prism//lib/prism/node.rb#16352 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # Return a symbol representation of this node type. See `Node#type`. # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#18808 + # source://prism//lib/prism/node.rb#16370 sig { override.returns(Symbol) } def type; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#18745 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#18818 + # source://prism//lib/prism/node.rb#16375 def type; end end end @@ -38850,107 +35205,109 @@ end # `foo` # ^^^^^ # -# source://prism//lib/prism/node.rb#18838 +# source://prism//lib/prism/node.rb#16395 class Prism::XStringNode < ::Prism::Node include ::Prism::HeredocQuery - # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void + # Initialize a new XStringNode node. # # @return [XStringNode] a new instance of XStringNode # - # source://prism//lib/prism/node.rb#18840 + # source://prism//lib/prism/node.rb#16397 sig do params( source: Prism::Source, + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, content_loc: Prism::Location, closing_loc: Prism::Location, - unescaped: String, - location: Prism::Location + unescaped: String ).void end - def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); 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#18971 + # source://prism//lib/prism/node.rb#16507 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18851 + # source://prism//lib/prism/node.rb#16409 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#18856 + # source://prism//lib/prism/node.rb#16414 sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#18932 + # source://prism//lib/prism/node.rb#16486 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#18902 + # source://prism//lib/prism/node.rb#16466 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18866 + # source://prism//lib/prism/node.rb#16424 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#18861 + # source://prism//lib/prism/node.rb#16419 sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism//lib/prism/node.rb#18927 + # source://prism//lib/prism/node.rb#16481 sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//lib/prism/node.rb#18895 + # source://prism//lib/prism/node.rb#16459 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 + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode # - # source://prism//lib/prism/node.rb#18871 + # source://prism//lib/prism/node.rb#16429 sig do params( + node_id: Integer, + location: Prism::Location, flags: Integer, opening_loc: Prism::Location, content_loc: Prism::Location, closing_loc: Prism::Location, - unescaped: String, - location: Prism::Location + unescaped: String ).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 copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18856 + # source://prism//lib/prism/node.rb#16414 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 } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String } # - # source://prism//lib/prism/node.rb#18879 + # source://prism//lib/prism/node.rb#16437 sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end @@ -38961,7 +35318,7 @@ class Prism::XStringNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#18917 + # source://prism//lib/prism/node.rb#16447 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -38969,7 +35326,7 @@ class Prism::XStringNode < ::Prism::Node # # @return [Boolean] # - # source://prism//lib/prism/node.rb#18912 + # source://prism//lib/prism/node.rb#16442 sig { returns(T::Boolean) } def forced_utf8_encoding?; end @@ -38978,71 +35335,45 @@ class Prism::XStringNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#18937 + # source://prism//lib/prism/node.rb#16491 sig { override.returns(String) } def inspect; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#18922 + # source://prism//lib/prism/node.rb#16476 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#18888 + # source://prism//lib/prism/node.rb#16452 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#86 + # source://prism//lib/prism/node_ext.rb#90 sig { returns(Prism::InterpolatedXStringNode) } def to_interpolated; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Return a symbol representation of this node type. See `Node#type`. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//lib/prism/node.rb#18955 + # source://prism//lib/prism/node.rb#16496 sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#18909 + # source://prism//lib/prism/node.rb#16473 sig { returns(String) } def unescaped; end - protected - - # protected attr_reader flags: Integer - # - # source://prism//lib/prism/node.rb#18884 - 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 + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#18965 + # source://prism//lib/prism/node.rb#16501 def type; end end end @@ -39052,86 +35383,60 @@ end # yield 1 # ^^^^^^^ # -# source://prism//lib/prism/node.rb#18985 +# source://prism//lib/prism/node.rb#16521 class Prism::YieldNode < ::Prism::Node - # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Location location) -> void + # Initialize a new YieldNode node. # # @return [YieldNode] a new instance of YieldNode # - # source://prism//lib/prism/node.rb#18987 - 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 + # source://prism//lib/prism/node.rb#16523 + def initialize(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc); 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#19117 + # source://prism//lib/prism/node.rb#16637 def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18997 - sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + # source://prism//lib/prism/node.rb#16535 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#19052 - sig { returns(T.nilable(Prism::ArgumentsNode)) } + # source://prism//lib/prism/node.rb#16590 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#19002 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#16540 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#19014 - sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + # source://prism//lib/prism/node.rb#16552 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#19007 - sig { override.returns(T::Array[Prism::Node]) } + # source://prism//lib/prism/node.rb#16545 def compact_child_nodes; end - # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?location: Location) -> YieldNode + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode # - # source://prism//lib/prism/node.rb#19019 - 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 + # source://prism//lib/prism/node.rb#16557 + def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#19002 - sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism//lib/prism/node.rb#16540 def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location? } # - # source://prism//lib/prism/node.rb#19027 - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + # source://prism//lib/prism/node.rb#16565 def deconstruct_keys(keys); end sig { override.returns(T::Array[Prism::Reflection::Field]) } @@ -39139,74 +35444,50 @@ class Prism::YieldNode < ::Prism::Node # def inspect -> String # - # source://prism//lib/prism/node.rb#19083 + # source://prism//lib/prism/node.rb#16621 sig { override.returns(String) } def inspect; end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#19068 - sig { returns(String) } + # source://prism//lib/prism/node.rb#16606 def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#19032 - sig { returns(Prism::Location) } + # source://prism//lib/prism/node.rb#16570 def keyword_loc; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#19073 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#16611 def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#19039 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#16577 def lparen_loc; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#19078 - sig { returns(T.nilable(String)) } + # source://prism//lib/prism/node.rb#16616 def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#19055 - sig { returns(T.nilable(Prism::Location)) } + # source://prism//lib/prism/node.rb#16593 def rparen_loc; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # Return a symbol representation of this node type. See `Node#type`. # - # source://prism//lib/prism/node.rb#19101 + # source://prism//lib/prism/node.rb#16626 sig { override.returns(Symbol) } def type; end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol + # Return a symbol representation of this node type. See `Node::type`. # - # source://prism//lib/prism/node.rb#19111 + # source://prism//lib/prism/node.rb#16631 def type; end end end diff --git a/sorbet/rbi/gems/rbi@0.1.14.rbi b/sorbet/rbi/gems/rbi@0.2.0.rbi similarity index 72% rename from sorbet/rbi/gems/rbi@0.1.14.rbi rename to sorbet/rbi/gems/rbi@0.2.0.rbi index 1ac1c5992..0315ca4be 100644 --- a/sorbet/rbi/gems/rbi@0.1.14.rbi +++ b/sorbet/rbi/gems/rbi@0.2.0.rbi @@ -8,21 +8,21 @@ # source://rbi//lib/rbi.rb#7 module RBI; end -# source://rbi//lib/rbi/model.rb#1043 +# source://rbi//lib/rbi/model.rb#1045 class RBI::Arg < ::RBI::Node - # source://rbi//lib/rbi/model.rb#1055 + # source://rbi//lib/rbi/model.rb#1057 sig { params(value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(value, loc: T.unsafe(nil)); end - # source://rbi//lib/rbi/model.rb#1061 + # source://rbi//lib/rbi/model.rb#1063 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/model.rb#1066 + # source://rbi//lib/rbi/model.rb#1068 sig { returns(::String) } def to_s; end - # source://rbi//lib/rbi/model.rb#1047 + # source://rbi//lib/rbi/model.rb#1049 sig { returns(::String) } def value; end end @@ -50,7 +50,7 @@ class RBI::Attr < ::RBI::NodeWithComments end def initialize(name, names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#414 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#420 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -70,7 +70,7 @@ class RBI::Attr < ::RBI::NodeWithComments sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#422 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#428 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end @@ -110,7 +110,7 @@ class RBI::Attr < ::RBI::NodeWithComments params( name: ::String, sig: T.nilable(::RBI::Sig), - attribute_type: T.nilable(::String), + attribute_type: T.nilable(T.any(::RBI::Type, ::String)), visibility: ::RBI::Visibility, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment] @@ -121,7 +121,7 @@ class RBI::Attr < ::RBI::NodeWithComments # @raise [UnexpectedMultipleSigsError] # # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#66 - sig(:final) { returns([T.nilable(::RBI::Sig), T.nilable(::String)]) } + sig(:final) { returns([T.nilable(::RBI::Sig), T.nilable(T.any(::RBI::Type, ::String))]) } def parse_sig; end end @@ -141,7 +141,7 @@ class RBI::AttrAccessor < ::RBI::Attr end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#454 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#460 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -174,7 +174,7 @@ class RBI::AttrReader < ::RBI::Attr end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#436 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#442 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -207,7 +207,7 @@ class RBI::AttrWriter < ::RBI::Attr end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#445 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#451 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -269,7 +269,7 @@ class RBI::Class < ::RBI::Scope end def initialize(name, superclass_name: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#378 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#384 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -331,28 +331,28 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#591 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#583 class RBI::ConflictTree < ::RBI::Tree - # source://rbi//lib/rbi/rewriters/merge_trees.rb#601 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#593 sig { params(left_name: ::String, right_name: ::String).void } def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#595 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#587 sig { returns(::RBI::Tree) } def left; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#598 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#590 sig { returns(::String) } def left_name; end # @return [Tree] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#595 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#587 def right; end # @return [String] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#598 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#590 def right_name; end end @@ -374,7 +374,7 @@ class RBI::Const < ::RBI::NodeWithComments end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#405 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#411 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -422,7 +422,7 @@ class RBI::Extend < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#504 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#510 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -464,7 +464,7 @@ class RBI::File sig { returns(T::Boolean) } def empty?; end - # source://rbi//lib/rbi/printer.rb#744 + # source://rbi//lib/rbi/printer.rb#743 sig do params( out: T.any(::IO, ::StringIO), @@ -493,7 +493,7 @@ class RBI::File # source://rbi//lib/rbi/model.rb#146 def strictness=(_arg0); end - # source://rbi//lib/rbi/printer.rb#750 + # source://rbi//lib/rbi/printer.rb#749 sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end end @@ -507,11 +507,11 @@ class RBI::Formatter group_nodes: T::Boolean, max_line_length: T.nilable(::Integer), nest_singleton_methods: T::Boolean, - nest_non_public_methods: T::Boolean, + nest_non_public_members: T::Boolean, sort_nodes: T::Boolean ).void end - def initialize(add_sig_templates: T.unsafe(nil), group_nodes: T.unsafe(nil), max_line_length: T.unsafe(nil), nest_singleton_methods: T.unsafe(nil), nest_non_public_methods: T.unsafe(nil), sort_nodes: T.unsafe(nil)); end + def initialize(add_sig_templates: T.unsafe(nil), group_nodes: T.unsafe(nil), max_line_length: T.unsafe(nil), nest_singleton_methods: T.unsafe(nil), nest_non_public_members: T.unsafe(nil), sort_nodes: T.unsafe(nil)); end # source://rbi//lib/rbi/formatter.rb#47 sig { params(file: ::RBI::File).void } @@ -553,19 +553,19 @@ end # source://rbi//lib/rbi/rewriters/group_nodes.rb#99 class RBI::Group::Kind < ::T::Enum enums do - Mixins = new - RequiredAncestors = new - Helpers = new - TypeMembers = new - MixesInClassMethods = new - Sends = new Attrs = new - TStructFields = new - TEnums = new + Consts = new + Helpers = new Inits = new Methods = new + MixesInClassMethods = new + Mixins = new + RequiredAncestors = new + Sends = new SingletonClasses = new - Consts = new + TEnums = new + TStructFields = new + TypeMembers = new end end @@ -589,7 +589,7 @@ class RBI::Helper < ::RBI::NodeWithComments end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#522 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#528 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -622,7 +622,7 @@ class RBI::Include < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#495 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#501 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -690,21 +690,21 @@ module RBI::Indexable def index_ids; end end -# source://rbi//lib/rbi/model.rb#1071 +# source://rbi//lib/rbi/model.rb#1073 class RBI::KwArg < ::RBI::Arg - # source://rbi//lib/rbi/model.rb#1084 + # source://rbi//lib/rbi/model.rb#1086 sig { params(keyword: ::String, value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(keyword, value, loc: T.unsafe(nil)); end - # source://rbi//lib/rbi/model.rb#1090 + # source://rbi//lib/rbi/model.rb#1092 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/model.rb#1075 + # source://rbi//lib/rbi/model.rb#1077 sig { returns(::String) } def keyword; end - # source://rbi//lib/rbi/model.rb#1095 + # source://rbi//lib/rbi/model.rb#1097 sig { returns(::String) } def to_s; end end @@ -909,7 +909,7 @@ class RBI::Method < ::RBI::NodeWithComments sig do params( params: T::Array[::RBI::SigParam], - return_type: T.nilable(::String), + return_type: T.any(::RBI::Type, ::String), is_abstract: T::Boolean, is_override: T::Boolean, is_overridable: T::Boolean, @@ -921,7 +921,7 @@ class RBI::Method < ::RBI::NodeWithComments end def add_sig(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#463 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#469 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -942,7 +942,7 @@ class RBI::Method < ::RBI::NodeWithComments # source://rbi//lib/rbi/model.rb#495 def is_singleton=(_arg0); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#472 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#478 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end @@ -998,7 +998,7 @@ class RBI::MixesInClassMethods < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#513 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#519 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -1030,7 +1030,7 @@ class RBI::Mixin < ::RBI::NodeWithComments end def initialize(name, names, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#486 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#492 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -1052,7 +1052,7 @@ class RBI::Module < ::RBI::Scope end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#387 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#393 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -1122,7 +1122,7 @@ class RBI::Node # source://rbi//lib/rbi/model.rb#14 def parent_tree=(_arg0); end - # source://rbi//lib/rbi/printer.rb#768 + # source://rbi//lib/rbi/printer.rb#767 sig do params( out: T.any(::IO, ::StringIO), @@ -1143,7 +1143,7 @@ class RBI::Node sig { params(version: ::Gem::Version).returns(T::Boolean) } def satisfies_version?(version); end - # source://rbi//lib/rbi/printer.rb#774 + # source://rbi//lib/rbi/printer.rb#773 sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end end @@ -1268,21 +1268,21 @@ class RBI::Parser end end -# source://rbi//lib/rbi/parser.rb#791 +# source://rbi//lib/rbi/parser.rb#828 class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor - # source://rbi//lib/rbi/parser.rb#798 + # source://rbi//lib/rbi/parser.rb#835 sig { params(content: ::String, file: ::String).void } def initialize(content, file:); end - # source://rbi//lib/rbi/parser.rb#795 + # source://rbi//lib/rbi/parser.rb#832 sig { returns(::RBI::Sig) } def current; end - # source://rbi//lib/rbi/parser.rb#850 + # source://rbi//lib/rbi/parser.rb#887 sig { override.params(node: ::Prism::AssocNode).void } def visit_assoc_node(node); end - # source://rbi//lib/rbi/parser.rb#805 + # source://rbi//lib/rbi/parser.rb#842 sig { override.params(node: ::Prism::CallNode).void } def visit_call_node(node); end end @@ -1301,39 +1301,39 @@ class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor sig { returns(::RBI::Tree) } def tree; end - # source://rbi//lib/rbi/parser.rb#299 + # source://rbi//lib/rbi/parser.rb#324 sig { params(node: ::Prism::CallNode).void } def visit_call_node(node); end - # source://rbi//lib/rbi/parser.rb#176 + # source://rbi//lib/rbi/parser.rb#175 sig { override.params(node: ::Prism::ClassNode).void } def visit_class_node(node); end - # source://rbi//lib/rbi/parser.rb#208 + # source://rbi//lib/rbi/parser.rb#224 sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).void } def visit_constant_assign(node); end - # source://rbi//lib/rbi/parser.rb#201 + # source://rbi//lib/rbi/parser.rb#217 sig { override.params(node: ::Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end - # source://rbi//lib/rbi/parser.rb#194 + # source://rbi//lib/rbi/parser.rb#210 sig { override.params(node: ::Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end - # source://rbi//lib/rbi/parser.rb#241 + # source://rbi//lib/rbi/parser.rb#257 sig { override.params(node: ::Prism::DefNode).void } def visit_def_node(node); end - # source://rbi//lib/rbi/parser.rb#255 + # source://rbi//lib/rbi/parser.rb#278 sig { override.params(node: ::Prism::ModuleNode).void } def visit_module_node(node); end - # source://rbi//lib/rbi/parser.rb#272 + # source://rbi//lib/rbi/parser.rb#296 sig { override.params(node: ::Prism::ProgramNode).void } def visit_program_node(node); end - # source://rbi//lib/rbi/parser.rb#283 + # source://rbi//lib/rbi/parser.rb#307 sig { override.params(node: ::Prism::SingletonClassNode).void } def visit_singleton_class_node(node); end @@ -1341,49 +1341,49 @@ class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor # Collect all the remaining comments within a node # - # source://rbi//lib/rbi/parser.rb#467 + # source://rbi//lib/rbi/parser.rb#503 sig { params(node: ::Prism::Node).void } def collect_dangling_comments(node); end # Collect all the remaining comments after visiting the tree # - # source://rbi//lib/rbi/parser.rb#485 + # source://rbi//lib/rbi/parser.rb#521 sig { void } def collect_orphan_comments; end - # source://rbi//lib/rbi/parser.rb#508 + # source://rbi//lib/rbi/parser.rb#544 sig { returns(::RBI::Tree) } def current_scope; end - # source://rbi//lib/rbi/parser.rb#513 + # source://rbi//lib/rbi/parser.rb#549 sig { returns(T::Array[::RBI::Sig]) } def current_sigs; end - # source://rbi//lib/rbi/parser.rb#520 - sig { returns(T::Array[::RBI::Comment]) } - def current_sigs_comments; end + # source://rbi//lib/rbi/parser.rb#556 + sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) } + def detach_comments_from_sigs(sigs); end - # source://rbi//lib/rbi/parser.rb#527 + # source://rbi//lib/rbi/parser.rb#568 sig { params(node: ::Prism::Node).returns(T::Array[::RBI::Comment]) } def node_comments(node); end - # source://rbi//lib/rbi/parser.rb#545 + # source://rbi//lib/rbi/parser.rb#586 sig { params(node: ::Prism::Comment).returns(::RBI::Comment) } def parse_comment(node); end - # source://rbi//lib/rbi/parser.rb#574 + # source://rbi//lib/rbi/parser.rb#615 sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Param]) } def parse_params(node); end - # source://rbi//lib/rbi/parser.rb#550 + # source://rbi//lib/rbi/parser.rb#591 sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Arg]) } def parse_send_args(node); end - # source://rbi//lib/rbi/parser.rb#648 + # source://rbi//lib/rbi/parser.rb#689 sig { params(node: ::Prism::CallNode).returns(::RBI::Sig) } def parse_sig(node); end - # source://rbi//lib/rbi/parser.rb#658 + # source://rbi//lib/rbi/parser.rb#698 sig do params( node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode) @@ -1391,23 +1391,23 @@ class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor end def parse_struct(node); end - # source://rbi//lib/rbi/parser.rb#708 + # source://rbi//lib/rbi/parser.rb#748 sig { params(send: ::Prism::CallNode).void } def parse_tstruct_field(send); end - # source://rbi//lib/rbi/parser.rb#745 + # source://rbi//lib/rbi/parser.rb#785 sig { params(name: ::String, node: ::Prism::Node).returns(::RBI::Visibility) } def parse_visibility(name, node); end - # source://rbi//lib/rbi/parser.rb#759 + # source://rbi//lib/rbi/parser.rb#799 sig { void } def separate_header_comments; end - # source://rbi//lib/rbi/parser.rb#769 + # source://rbi//lib/rbi/parser.rb#809 sig { void } def set_root_tree_loc; end - # source://rbi//lib/rbi/parser.rb#783 + # source://rbi//lib/rbi/parser.rb#823 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def type_variable_definition?(node); end end @@ -1521,35 +1521,35 @@ class RBI::Printer < ::RBI::Visitor private - # source://rbi//lib/rbi/printer.rb#619 + # source://rbi//lib/rbi/printer.rb#618 sig { params(node: ::RBI::Node).returns(T::Boolean) } def oneline?(node); end - # source://rbi//lib/rbi/printer.rb#577 + # source://rbi//lib/rbi/printer.rb#576 sig { params(node: ::RBI::Node).void } def print_blank_line_before(node); end - # source://rbi//lib/rbi/printer.rb#587 + # source://rbi//lib/rbi/printer.rb#586 sig { params(node: ::RBI::Node).void } def print_loc(node); end - # source://rbi//lib/rbi/printer.rb#593 + # source://rbi//lib/rbi/printer.rb#592 sig { params(node: ::RBI::Param, last: T::Boolean).void } def print_param_comment_leading_space(node, last:); end - # source://rbi//lib/rbi/printer.rb#666 + # source://rbi//lib/rbi/printer.rb#665 sig { params(node: ::RBI::Sig).void } def print_sig_as_block(node); end - # source://rbi//lib/rbi/printer.rb#641 + # source://rbi//lib/rbi/printer.rb#640 sig { params(node: ::RBI::Sig).void } def print_sig_as_line(node); end - # source://rbi//lib/rbi/printer.rb#611 + # source://rbi//lib/rbi/printer.rb#610 sig { params(node: ::RBI::SigParam, last: T::Boolean).void } def print_sig_param_comment_leading_space(node, last:); end - # source://rbi//lib/rbi/printer.rb#722 + # source://rbi//lib/rbi/printer.rb#721 sig { params(node: ::RBI::Sig).returns(T::Array[::String]) } def sig_modifiers(node); end @@ -1589,7 +1589,7 @@ class RBI::Printer < ::RBI::Visitor sig { override.params(node: ::RBI::Comment).void } def visit_comment(node); end - # source://rbi//lib/rbi/printer.rb#554 + # source://rbi//lib/rbi/printer.rb#553 sig { override.params(node: ::RBI::ConflictTree).void } def visit_conflict_tree(node); end @@ -1601,11 +1601,11 @@ class RBI::Printer < ::RBI::Visitor sig { override.params(node: ::RBI::Extend).void } def visit_extend(node); end - # source://rbi//lib/rbi/printer.rb#526 + # source://rbi//lib/rbi/printer.rb#525 sig { override.params(node: ::RBI::Group).void } def visit_group(node); end - # source://rbi//lib/rbi/printer.rb#512 + # source://rbi//lib/rbi/printer.rb#511 sig { override.params(node: ::RBI::Helper).void } def visit_helper(node); end @@ -1633,7 +1633,7 @@ class RBI::Printer < ::RBI::Visitor sig { override.params(node: ::RBI::Method).void } def visit_method(node); end - # source://rbi//lib/rbi/printer.rb#521 + # source://rbi//lib/rbi/printer.rb#520 sig { override.params(node: ::RBI::MixesInClassMethods).void } def visit_mixes_in_class_methods(node); end @@ -1665,7 +1665,7 @@ class RBI::Printer < ::RBI::Visitor sig { override.params(node: ::RBI::ReqParam).void } def visit_req_param(node); end - # source://rbi//lib/rbi/printer.rb#545 + # source://rbi//lib/rbi/printer.rb#544 sig { override.params(node: ::RBI::RequiresAncestor).void } def visit_requires_ancestor(node); end @@ -1681,7 +1681,7 @@ class RBI::Printer < ::RBI::Visitor sig { params(node: ::RBI::Scope).void } def visit_scope_body(node); end - # source://rbi//lib/rbi/printer.rb#563 + # source://rbi//lib/rbi/printer.rb#562 sig { override.params(node: ::RBI::ScopeConflict).void } def visit_scope_conflict(node); end @@ -1697,7 +1697,7 @@ class RBI::Printer < ::RBI::Visitor sig { override.params(node: ::RBI::Sig).void } def visit_sig(node); end - # source://rbi//lib/rbi/printer.rb#446 + # source://rbi//lib/rbi/printer.rb#447 sig { override.params(node: ::RBI::SigParam).void } def visit_sig_param(node); end @@ -1709,15 +1709,15 @@ class RBI::Printer < ::RBI::Visitor sig { override.params(node: ::RBI::Struct).void } def visit_struct(node); end - # source://rbi//lib/rbi/printer.rb#466 + # source://rbi//lib/rbi/printer.rb#467 sig { params(node: ::RBI::TStructField).void } def visit_t_struct_field(node); end - # source://rbi//lib/rbi/printer.rb#484 + # source://rbi//lib/rbi/printer.rb#485 sig { override.params(node: ::RBI::TEnum).void } def visit_tenum(node); end - # source://rbi//lib/rbi/printer.rb#489 + # source://rbi//lib/rbi/printer.rb#490 sig { override.params(node: ::RBI::TEnumBlock).void } def visit_tenum_block(node); end @@ -1725,19 +1725,19 @@ class RBI::Printer < ::RBI::Visitor sig { override.params(node: ::RBI::Tree).void } def visit_tree(node); end - # source://rbi//lib/rbi/printer.rb#451 + # source://rbi//lib/rbi/printer.rb#452 sig { override.params(node: ::RBI::TStruct).void } def visit_tstruct(node); end - # source://rbi//lib/rbi/printer.rb#456 + # source://rbi//lib/rbi/printer.rb#457 sig { override.params(node: ::RBI::TStructConst).void } def visit_tstruct_const(node); end - # source://rbi//lib/rbi/printer.rb#461 + # source://rbi//lib/rbi/printer.rb#462 sig { override.params(node: ::RBI::TStructProp).void } def visit_tstruct_prop(node); end - # source://rbi//lib/rbi/printer.rb#503 + # source://rbi//lib/rbi/printer.rb#502 sig { override.params(node: ::RBI::TypeMember).void } def visit_type_member(node); end @@ -1745,7 +1745,7 @@ class RBI::Printer < ::RBI::Visitor sig { params(node: ::RBI::Visibility).void } def visit_visibility(node); end - # source://rbi//lib/rbi/printer.rb#532 + # source://rbi//lib/rbi/printer.rb#531 sig { override.params(node: ::RBI::VisibilityGroup).void } def visit_visibility_group(node); end end @@ -1753,9 +1753,9 @@ end # source://rbi//lib/rbi/printer.rb#5 class RBI::PrinterError < ::RBI::Error; end -# source://rbi//lib/rbi/model.rb#984 +# source://rbi//lib/rbi/model.rb#986 class RBI::Private < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#994 + # source://rbi//lib/rbi/model.rb#996 sig do params( loc: T.nilable(::RBI::Loc), @@ -1766,9 +1766,9 @@ class RBI::Private < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#968 +# source://rbi//lib/rbi/model.rb#970 class RBI::Protected < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#978 + # source://rbi//lib/rbi/model.rb#980 sig do params( loc: T.nilable(::RBI::Loc), @@ -1779,9 +1779,9 @@ class RBI::Protected < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#952 +# source://rbi//lib/rbi/model.rb#954 class RBI::Public < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#962 + # source://rbi//lib/rbi/model.rb#964 sig do params( loc: T.nilable(::RBI::Loc), @@ -2009,6 +2009,71 @@ end # source://rbi//lib/rbi/rewriters/filter_versions.rb#60 RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String) +# Rewrite non-singleton methods inside singleton classes to singleton methods +# +# Example: +# ~~~rb +# class << self +# def m1; end +# def self.m2; end +# +# class << self +# def m3; end +# end +# end +# ~~~ +# +# will be rewritten to: +# +# ~~~rb +# def self.m1; end +# +# class << self +# def self.m2; end +# def self.m3; end +# end +# ~~~ +# +# source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#30 +class RBI::Rewriters::FlattenSingletonMethods < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#34 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + +# Flattens visibility nodes into method nodes +# +# Example: +# ~~~rb +# class A +# def m1; end +# private +# def m2; end +# def m3; end +# end +# ~~~ +# +# will be transformed into: +# +# ~~~rb +# class A +# def m1; end +# private def m2; end +# private def m3; end +# end +# ~~~ +# +# source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#27 +class RBI::Rewriters::FlattenVisibilities < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#31 + sig { void } + def initialize; end + + # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#38 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + # source://rbi//lib/rbi/rewriters/group_nodes.rb#8 class RBI::Rewriters::GroupNodes < ::RBI::Visitor # source://rbi//lib/rbi/rewriters/group_nodes.rb#12 @@ -2099,7 +2164,7 @@ class RBI::Rewriters::Merge::Conflict < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11520/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11545/lib/types/struct.rb#13 def inherited(s); end end end @@ -2155,8 +2220,8 @@ end # source://rbi//lib/rbi/rewriters/merge_trees.rb#42 class RBI::Rewriters::Merge::Keep < ::T::Enum enums do - NONE = new LEFT = new + NONE = new RIGHT = new end end @@ -2205,9 +2270,9 @@ class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor def replace_scope_header(left, right); end end -# source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#6 -class RBI::Rewriters::NestNonPublicMethods < ::RBI::Visitor - # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#10 +# source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#6 +class RBI::Rewriters::NestNonPublicMembers < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#10 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end end @@ -2219,6 +2284,34 @@ class RBI::Rewriters::NestSingletonMethods < ::RBI::Visitor def visit(node); end end +# This rewriter moves top-level members into a top-level Object class +# +# Example: +# ~~~rb +# def foo; end +# attr_reader :bar +# ~~~ +# +# will be rewritten to: +# +# ~~~rb +# class Object +# def foo; end +# attr_reader :bar +# end +# ~~~ +# +# source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#22 +class RBI::Rewriters::NestTopLevelMembers < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#26 + sig { void } + def initialize; end + + # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#33 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + # Remove all definitions existing in the index from the current tree # # Let's create an `Index` from two different `Tree`s: @@ -2316,7 +2409,7 @@ class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11520/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11545/lib/types/struct.rb#13 def inherited(s); end end end @@ -2390,38 +2483,38 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#624 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#616 class RBI::ScopeConflict < ::RBI::Tree - # source://rbi//lib/rbi/rewriters/merge_trees.rb#641 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#633 sig { params(left: ::RBI::Scope, right: ::RBI::Scope, left_name: ::String, right_name: ::String).void } def initialize(left:, right:, left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#628 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#620 sig { returns(::RBI::Scope) } def left; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#631 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#623 sig { returns(::String) } def left_name; end # @return [Scope] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#628 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#620 def right; end # @return [String] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#631 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#623 def right_name; end end # Sends # -# source://rbi//lib/rbi/model.rb#1002 +# source://rbi//lib/rbi/model.rb#1004 class RBI::Send < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1020 + # source://rbi//lib/rbi/model.rb#1022 sig do params( method: ::String, @@ -2433,19 +2526,19 @@ class RBI::Send < ::RBI::NodeWithComments end def initialize(method, args = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#1028 + # source://rbi//lib/rbi/model.rb#1030 sig { params(arg: ::RBI::Arg).void } def <<(arg); end - # source://rbi//lib/rbi/model.rb#1033 + # source://rbi//lib/rbi/model.rb#1035 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/model.rb#1009 + # source://rbi//lib/rbi/model.rb#1011 sig { returns(T::Array[::RBI::Arg]) } def args; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#531 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#537 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -2453,24 +2546,24 @@ class RBI::Send < ::RBI::NodeWithComments sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1006 + # source://rbi//lib/rbi/model.rb#1008 sig { returns(::String) } def method; end - # source://rbi//lib/rbi/model.rb#1038 + # source://rbi//lib/rbi/model.rb#1040 sig { returns(::String) } def to_s; end end # Sorbet's sigs # -# source://rbi//lib/rbi/model.rb#1102 -class RBI::Sig < ::RBI::Node - # source://rbi//lib/rbi/model.rb#1134 +# source://rbi//lib/rbi/model.rb#1104 +class RBI::Sig < ::RBI::NodeWithComments + # source://rbi//lib/rbi/model.rb#1137 sig do params( params: T::Array[::RBI::SigParam], - return_type: T.nilable(::String), + return_type: T.any(::RBI::Type, ::String), is_abstract: T::Boolean, is_override: T::Boolean, is_overridable: T::Boolean, @@ -2478,96 +2571,97 @@ class RBI::Sig < ::RBI::Node type_params: T::Array[::String], checked: T.nilable(::Symbol), loc: T.nilable(::RBI::Loc), + comments: T::Array[::RBI::Comment], block: T.nilable(T.proc.params(node: ::RBI::Sig).void) ).void end - def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), &block); end + def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#1159 + # source://rbi//lib/rbi/model.rb#1163 sig { params(param: ::RBI::SigParam).void } def <<(param); end - # source://rbi//lib/rbi/model.rb#1169 + # source://rbi//lib/rbi/model.rb#1173 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/model.rb#1164 - sig { params(name: ::String, type: ::String).void } + # source://rbi//lib/rbi/model.rb#1168 + sig { params(name: ::String, type: T.any(::RBI::Type, ::String)).void } def add_param(name, type); end - # source://rbi//lib/rbi/model.rb#1118 + # source://rbi//lib/rbi/model.rb#1120 sig { returns(T.nilable(::Symbol)) } def checked; end # @return [Symbol, nil] # - # source://rbi//lib/rbi/model.rb#1118 + # source://rbi//lib/rbi/model.rb#1120 def checked=(_arg0); end - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1114 sig { returns(T::Boolean) } def is_abstract; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1114 def is_abstract=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1114 def is_final; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1114 def is_final=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1114 def is_overridable; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1114 def is_overridable=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1114 def is_override; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1114 def is_override=(_arg0); end - # source://rbi//lib/rbi/model.rb#1106 + # source://rbi//lib/rbi/model.rb#1108 sig { returns(T::Array[::RBI::SigParam]) } def params; end - # source://rbi//lib/rbi/model.rb#1109 - sig { returns(T.nilable(::String)) } + # source://rbi//lib/rbi/model.rb#1111 + sig { returns(T.any(::RBI::Type, ::String)) } def return_type; end - # @return [String, nil] + # @return [Type, String] # - # source://rbi//lib/rbi/model.rb#1109 + # source://rbi//lib/rbi/model.rb#1111 def return_type=(_arg0); end - # source://rbi//lib/rbi/model.rb#1115 + # source://rbi//lib/rbi/model.rb#1117 sig { returns(T::Array[::String]) } def type_params; end end -# source://rbi//lib/rbi/model.rb#1178 +# source://rbi//lib/rbi/model.rb#1182 class RBI::SigParam < ::RBI::NodeWithComments - # source://rbi//lib/rbi/model.rb#1193 + # source://rbi//lib/rbi/model.rb#1200 sig do params( name: ::String, - type: ::String, + type: T.any(::RBI::Type, ::String), loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment], block: T.nilable(T.proc.params(node: ::RBI::SigParam).void) @@ -2575,17 +2669,16 @@ class RBI::SigParam < ::RBI::NodeWithComments end def initialize(name, type, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#1201 + # source://rbi//lib/rbi/model.rb#1208 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/model.rb#1182 + # source://rbi//lib/rbi/model.rb#1186 sig { returns(::String) } def name; end - # @return [String] - # - # source://rbi//lib/rbi/model.rb#1182 + # source://rbi//lib/rbi/model.rb#1189 + sig { returns(T.any(::RBI::Type, ::String)) } def type; end end @@ -2621,7 +2714,7 @@ class RBI::Struct < ::RBI::Scope end def initialize(name, members: T.unsafe(nil), keyword_init: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#396 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#402 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end @@ -2659,9 +2752,9 @@ end # Sorbet's T::Enum # -# source://rbi//lib/rbi/model.rb#1319 +# source://rbi//lib/rbi/model.rb#1329 class RBI::TEnum < ::RBI::Class - # source://rbi//lib/rbi/model.rb#1330 + # source://rbi//lib/rbi/model.rb#1340 sig do params( name: ::String, @@ -2673,41 +2766,26 @@ class RBI::TEnum < ::RBI::Class def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1336 -class RBI::TEnumBlock < ::RBI::NodeWithComments - include ::RBI::Indexable - - # source://rbi//lib/rbi/model.rb#1350 +# source://rbi//lib/rbi/model.rb#1346 +class RBI::TEnumBlock < ::RBI::Scope + # source://rbi//lib/rbi/model.rb#1356 sig do params( - names: T::Array[::String], loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment], block: T.nilable(T.proc.params(node: ::RBI::TEnumBlock).void) ).void end - def initialize(names = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end # source://rbi//lib/rbi/model.rb#1362 - sig { params(name: ::String).void } - def <<(name); end - - # source://rbi//lib/rbi/model.rb#1357 - sig { returns(T::Boolean) } - def empty?; end + sig { override.returns(::String) } + def fully_qualified_name; end # source://rbi//lib/rbi/index.rb#223 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#558 - sig { override.params(other: ::RBI::Node).void } - def merge_with(other); end - - # source://rbi//lib/rbi/model.rb#1340 - sig { returns(T::Array[::String]) } - def names; end - # source://rbi//lib/rbi/model.rb#1367 sig { override.returns(::String) } def to_s; end @@ -2715,9 +2793,9 @@ end # Sorbet's T::Struct # -# source://rbi//lib/rbi/model.rb#1208 +# source://rbi//lib/rbi/model.rb#1215 class RBI::TStruct < ::RBI::Class - # source://rbi//lib/rbi/model.rb#1219 + # source://rbi//lib/rbi/model.rb#1226 sig do params( name: ::String, @@ -2729,15 +2807,15 @@ class RBI::TStruct < ::RBI::Class def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1257 +# source://rbi//lib/rbi/model.rb#1267 class RBI::TStructConst < ::RBI::TStructField include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1270 + # source://rbi//lib/rbi/model.rb#1280 sig do params( name: ::String, - type: ::String, + type: T.any(::RBI::Type, ::String), default: T.nilable(::String), loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment], @@ -2746,11 +2824,11 @@ class RBI::TStructConst < ::RBI::TStructField end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#549 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#555 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1276 + # source://rbi//lib/rbi/model.rb#1286 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end @@ -2758,22 +2836,22 @@ class RBI::TStructConst < ::RBI::TStructField sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1282 + # source://rbi//lib/rbi/model.rb#1292 sig { override.returns(::String) } def to_s; end end # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#1225 +# source://rbi//lib/rbi/model.rb#1232 class RBI::TStructField < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#1246 + # source://rbi//lib/rbi/model.rb#1256 sig do params( name: ::String, - type: ::String, + type: T.any(::RBI::Type, ::String), default: T.nilable(::String), loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment] @@ -2781,54 +2859,53 @@ class RBI::TStructField < ::RBI::NodeWithComments end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#540 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#546 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1235 + # source://rbi//lib/rbi/model.rb#1245 sig { returns(T.nilable(::String)) } def default; end # @return [String, nil] # - # source://rbi//lib/rbi/model.rb#1235 + # source://rbi//lib/rbi/model.rb#1245 def default=(_arg0); end # @abstract # - # source://rbi//lib/rbi/model.rb#1254 + # source://rbi//lib/rbi/model.rb#1264 sig { abstract.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/model.rb#1232 + # source://rbi//lib/rbi/model.rb#1239 sig { returns(::String) } def name; end # @return [String] # - # source://rbi//lib/rbi/model.rb#1232 + # source://rbi//lib/rbi/model.rb#1239 def name=(_arg0); end - # @return [String] - # - # source://rbi//lib/rbi/model.rb#1232 + # source://rbi//lib/rbi/model.rb#1242 + sig { returns(T.any(::RBI::Type, ::String)) } def type; end - # @return [String] + # @return [Type, String] # - # source://rbi//lib/rbi/model.rb#1232 + # source://rbi//lib/rbi/model.rb#1242 def type=(_arg0); end end -# source://rbi//lib/rbi/model.rb#1287 +# source://rbi//lib/rbi/model.rb#1297 class RBI::TStructProp < ::RBI::TStructField include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1300 + # source://rbi//lib/rbi/model.rb#1310 sig do params( name: ::String, - type: ::String, + type: T.any(::RBI::Type, ::String), default: T.nilable(::String), loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment], @@ -2837,11 +2914,11 @@ class RBI::TStructProp < ::RBI::TStructField end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#572 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#564 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1306 + # source://rbi//lib/rbi/model.rb#1316 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end @@ -2849,7 +2926,7 @@ class RBI::TStructProp < ::RBI::TStructField sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1312 + # source://rbi//lib/rbi/model.rb#1322 sig { override.returns(::String) } def to_s; end end @@ -2951,6 +3028,14 @@ class RBI::Tree < ::RBI::NodeWithComments sig { params(version: ::Gem::Version).void } def filter_versions!(version); end + # source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#60 + sig { void } + def flatten_singleton_methods!; end + + # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#60 + sig { void } + def flatten_visibilities!; end + # source://rbi//lib/rbi/rewriters/group_nodes.rb#81 sig { void } def group_nodes!; end @@ -2970,14 +3055,18 @@ class RBI::Tree < ::RBI::NodeWithComments end def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#46 + # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#46 sig { void } - def nest_non_public_methods!; end + def nest_non_public_members!; end # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#36 sig { void } def nest_singleton_methods!; end + # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#63 + sig { void } + def nest_top_level_members!; end + # source://rbi//lib/rbi/model.rb#112 sig { returns(T::Array[::RBI::Node]) } def nodes; end @@ -3001,6 +3090,717 @@ class RBI::Tree < ::RBI::NodeWithComments def nodes_cache; end end +# The base class for all RBI types. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/type.rb#6 +class RBI::Type + abstract! + + # source://rbi//lib/rbi/type.rb#699 + sig { void } + def initialize; end + + # @abstract + # + # source://rbi//lib/rbi/type.rb#745 + sig { abstract.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#748 + sig { params(other: ::BasicObject).returns(T::Boolean) } + def eql?(other); end + + # source://rbi//lib/rbi/type.rb#753 + sig { override.returns(::Integer) } + def hash; end + + # Returns a new type that is `nilable` if it is not already. + # + # If the type is already nilable, it returns itself. + # ```ruby + # type = RBI::Type.simple("String") + # type.to_rbi # => "String" + # type.nilable.to_rbi # => "T.nilable(String)" + # type.nilable.nilable.to_rbi # => "T.nilable(String)" + # ``` + # + # source://rbi//lib/rbi/type.rb#713 + sig { returns(::RBI::Type) } + def nilable; end + + # Returns whether the type is nilable. + # + # source://rbi//lib/rbi/type.rb#740 + sig { returns(T::Boolean) } + def nilable?; end + + # Returns the non-nilable version of the type. + # If the type is already non-nilable, it returns itself. + # If the type is nilable, it returns the inner type. + # + # ```ruby + # type = RBI::Type.nilable(RBI::Type.simple("String")) + # type.to_rbi # => "T.nilable(String)" + # type.non_nilable.to_rbi # => "String" + # type.non_nilable.non_nilable.to_rbi # => "String" + # ``` + # + # source://rbi//lib/rbi/type.rb#728 + sig { returns(::RBI::Type) } + def non_nilable; end + + # @abstract + # + # source://rbi//lib/rbi/type.rb#758 + sig { abstract.returns(::String) } + def to_rbi; end + + # source://rbi//lib/rbi/type.rb#761 + sig { override.returns(::String) } + def to_s; end + + class << self + # Builds a type that represents an intersection of multiple types like `T.all(String, Integer)`. + # + # Note that this method transforms types such as `T.all(String, String)` into `String`, so + # it may return something other than a `All`. + # + # source://rbi//lib/rbi/type.rb#563 + sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) } + def all(type1, type2, *types); end + + # Builds a type that represents a union of multiple types like `T.any(String, Integer)`. + # + # Note that this method transforms types such as `T.any(String, NilClass)` into `T.nilable(String)`, so + # it may return something other than a `Any`. + # + # source://rbi//lib/rbi/type.rb#590 + sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) } + def any(type1, type2, *types); end + + # Builds a type that represents `T.anything`. + # + # source://rbi//lib/rbi/type.rb#488 + sig { returns(::RBI::Type::Anything) } + def anything; end + + # Builds a type that represents `T.attached_class`. + # + # source://rbi//lib/rbi/type.rb#494 + sig { returns(::RBI::Type::AttachedClass) } + def attached_class; end + + # Builds a type that represents `T::Boolean`. + # + # source://rbi//lib/rbi/type.rb#500 + sig { returns(::RBI::Type::Boolean) } + def boolean; end + + # Builds a type that represents the singleton class of another type like `T.class_of(Foo)`. + # + # source://rbi//lib/rbi/type.rb#538 + sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).returns(::RBI::Type::ClassOf) } + def class_of(type, type_parameter = T.unsafe(nil)); end + + # Builds a type that represents a generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. + # + # source://rbi//lib/rbi/type.rb#655 + sig { params(name: ::String, params: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Generic) } + def generic(name, *params); end + + # Builds a type that represents a nilable of another type like `T.nilable(String)`. + # + # Note that this method transforms types such as `T.nilable(T.untyped)` into `T.untyped`, so + # it may return something other than a `RBI::Type::Nilable`. + # + # source://rbi//lib/rbi/type.rb#547 + sig { params(type: ::RBI::Type).returns(::RBI::Type) } + def nilable(type); end + + # Builds a type that represents `T.noreturn`. + # + # source://rbi//lib/rbi/type.rb#506 + sig { returns(::RBI::Type::NoReturn) } + def noreturn; end + + # source://rbi//lib/rbi/type_parser.rb#26 + sig { params(node: ::Prism::Node).returns(::RBI::Type) } + def parse_node(node); end + + # @raise [Error] + # + # source://rbi//lib/rbi/type_parser.rb#10 + sig { params(string: ::String).returns(::RBI::Type) } + def parse_string(string); end + + # Builds a type that represents a proc type like `T.proc.void`. + # + # source://rbi//lib/rbi/type.rb#683 + sig { returns(::RBI::Type::Proc) } + def proc; end + + # Builds a type that represents `T.self_type`. + # + # source://rbi//lib/rbi/type.rb#512 + sig { returns(::RBI::Type::SelfType) } + def self_type; end + + # Builds a type that represents a shape type like `{name: String, age: Integer}`. + # + # source://rbi//lib/rbi/type.rb#675 + sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).returns(::RBI::Type::Shape) } + def shape(types = T.unsafe(nil)); end + + # Builds a simple type like `String` or `::Foo::Bar`. + # + # It raises a `NameError` if the name is not a valid Ruby class identifier. + # + # @raise [NameError] + # + # source://rbi//lib/rbi/type.rb#477 + sig { params(name: ::String).returns(::RBI::Type::Simple) } + def simple(name); end + + # Builds a type that represents the class of another type like `T::Class[Foo]`. + # + # source://rbi//lib/rbi/type.rb#532 + sig { params(type: ::RBI::Type).returns(::RBI::Type::Class) } + def t_class(type); end + + # Builds a type that represents a tuple type like `[String, Integer]`. + # + # source://rbi//lib/rbi/type.rb#669 + sig { params(types: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Tuple) } + def tuple(*types); end + + # Builds a type that represents a type parameter like `T.type_parameter(:U)`. + # + # source://rbi//lib/rbi/type.rb#661 + sig { params(name: ::Symbol).returns(::RBI::Type::TypeParameter) } + def type_parameter(name); end + + # Builds a type that represents `T.untyped`. + # + # source://rbi//lib/rbi/type.rb#518 + sig { returns(::RBI::Type::Untyped) } + def untyped; end + + # Builds a type that represents `void`. + # + # source://rbi//lib/rbi/type.rb#524 + sig { returns(::RBI::Type::Void) } + def void; end + + private + + # source://rbi//lib/rbi/type_parser.rb#263 + sig { params(node: ::Prism::CallNode).returns(T::Array[::Prism::Node]) } + def call_chain(node); end + + # source://rbi//lib/rbi/type_parser.rb#250 + sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) } + def check_arguments_at_least!(node, count); end + + # source://rbi//lib/rbi/type_parser.rb#235 + sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) } + def check_arguments_exactly!(node, count); end + + # @raise [Error] + # + # source://rbi//lib/rbi/type_parser.rb#69 + sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } + def parse_call(node); end + + # source://rbi//lib/rbi/type_parser.rb#52 + sig { params(node: T.any(::Prism::ConstantPathNode, ::Prism::ConstantReadNode)).returns(::RBI::Type) } + def parse_constant(node); end + + # @raise [Error] + # + # source://rbi//lib/rbi/type_parser.rb#195 + sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } + def parse_proc(node); end + + # source://rbi//lib/rbi/type_parser.rb#176 + sig { params(node: T.any(::Prism::HashNode, ::Prism::KeywordHashNode)).returns(::RBI::Type) } + def parse_shape(node); end + + # source://rbi//lib/rbi/type_parser.rb#171 + sig { params(node: ::Prism::ArrayNode).returns(::RBI::Type) } + def parse_tuple(node); end + + # source://rbi//lib/rbi/type_parser.rb#276 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t?(node); end + + # source://rbi//lib/rbi/type_parser.rb#288 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_boolean?(node); end + + # source://rbi//lib/rbi/type_parser.rb#295 + sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) } + def t_class?(node); end + + # source://rbi//lib/rbi/type_parser.rb#300 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_class_of?(node); end + + # source://rbi//lib/rbi/type_parser.rb#307 + sig { params(node: ::Prism::CallNode).returns(T::Boolean) } + def t_proc?(node); end + + # source://rbi//lib/rbi/type.rb#693 + sig { params(name: ::String).returns(T::Boolean) } + def valid_identifier?(name); end + end +end + +# A type that is intersection of multiple types like `T.all(String, Integer)`. +# +# source://rbi//lib/rbi/type.rb#252 +class RBI::Type::All < ::RBI::Type::Composite + # source://rbi//lib/rbi/type.rb#256 + sig { override.returns(::String) } + def to_rbi; end +end + +# A type that is union of multiple types like `T.any(String, Integer)`. +# +# source://rbi//lib/rbi/type.rb#262 +class RBI::Type::Any < ::RBI::Type::Composite + # source://rbi//lib/rbi/type.rb#271 + sig { returns(T::Boolean) } + def nilable?; end + + # source://rbi//lib/rbi/type.rb#266 + sig { override.returns(::String) } + def to_rbi; end +end + +# `T.anything`. +# +# source://rbi//lib/rbi/type.rb#43 +class RBI::Type::Anything < ::RBI::Type + # source://rbi//lib/rbi/type.rb#47 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#52 + sig { override.returns(::String) } + def to_rbi; end +end + +# `T.attached_class`. +# +# source://rbi//lib/rbi/type.rb#58 +class RBI::Type::AttachedClass < ::RBI::Type + # source://rbi//lib/rbi/type.rb#62 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#67 + sig { override.returns(::String) } + def to_rbi; end +end + +# `T::Boolean`. +# +# source://rbi//lib/rbi/type.rb#73 +class RBI::Type::Boolean < ::RBI::Type + # source://rbi//lib/rbi/type.rb#77 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#82 + sig { override.returns(::String) } + def to_rbi; end +end + +# The class of another type like `T::Class[Foo]`. +# +# source://rbi//lib/rbi/type.rb#150 +class RBI::Type::Class < ::RBI::Type + # source://rbi//lib/rbi/type.rb#157 + sig { params(type: ::RBI::Type).void } + def initialize(type); end + + # source://rbi//lib/rbi/type.rb#163 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#168 + sig { override.returns(::String) } + def to_rbi; end + + # source://rbi//lib/rbi/type.rb#154 + sig { returns(::RBI::Type) } + def type; end +end + +# The singleton class of another type like `T.class_of(Foo)`. +# +# source://rbi//lib/rbi/type.rb#174 +class RBI::Type::ClassOf < ::RBI::Type + # source://rbi//lib/rbi/type.rb#184 + sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).void } + def initialize(type, type_parameter = T.unsafe(nil)); end + + # source://rbi//lib/rbi/type.rb#191 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#196 + sig { override.returns(::String) } + def to_rbi; end + + # source://rbi//lib/rbi/type.rb#178 + sig { returns(::RBI::Type::Simple) } + def type; end + + # source://rbi//lib/rbi/type.rb#181 + sig { returns(T.nilable(::RBI::Type)) } + def type_parameter; end +end + +# A type that is composed of multiple types like `T.all(String, Integer)`. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/type.rb#230 +class RBI::Type::Composite < ::RBI::Type + abstract! + + # source://rbi//lib/rbi/type.rb#240 + sig { params(types: T::Array[::RBI::Type]).void } + def initialize(types); end + + # source://rbi//lib/rbi/type.rb#246 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#237 + sig { returns(T::Array[::RBI::Type]) } + def types; end +end + +# source://rbi//lib/rbi/type_parser.rb#6 +class RBI::Type::Error < ::RBI::Error; end + +# A generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. +# +# source://rbi//lib/rbi/type.rb#279 +class RBI::Type::Generic < ::RBI::Type + # source://rbi//lib/rbi/type.rb#289 + sig { params(name: ::String, params: ::RBI::Type).void } + def initialize(name, *params); end + + # source://rbi//lib/rbi/type.rb#296 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#283 + sig { returns(::String) } + def name; end + + # source://rbi//lib/rbi/type.rb#286 + sig { returns(T::Array[::RBI::Type]) } + def params; end + + # source://rbi//lib/rbi/type.rb#301 + sig { override.returns(::String) } + def to_rbi; end +end + +# A type that can be `nil` like `T.nilable(String)`. +# +# source://rbi//lib/rbi/type.rb#206 +class RBI::Type::Nilable < ::RBI::Type + # source://rbi//lib/rbi/type.rb#213 + sig { params(type: ::RBI::Type).void } + def initialize(type); end + + # source://rbi//lib/rbi/type.rb#219 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#224 + sig { override.returns(::String) } + def to_rbi; end + + # source://rbi//lib/rbi/type.rb#210 + sig { returns(::RBI::Type) } + def type; end +end + +# `T.noreturn`. +# +# source://rbi//lib/rbi/type.rb#88 +class RBI::Type::NoReturn < ::RBI::Type + # source://rbi//lib/rbi/type.rb#92 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#97 + sig { override.returns(::String) } + def to_rbi; end +end + +# A proc type like `T.proc.void`. +# +# source://rbi//lib/rbi/type.rb#387 +class RBI::Type::Proc < ::RBI::Type + # source://rbi//lib/rbi/type.rb#400 + sig { void } + def initialize; end + + # source://rbi//lib/rbi/type.rb#408 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#436 + sig { params(type: T.untyped).returns(T.self_type) } + def bind(type); end + + # source://rbi//lib/rbi/type.rb#418 + sig { params(params: ::RBI::Type).returns(T.self_type) } + def params(**params); end + + # source://rbi//lib/rbi/type.rb#397 + sig { returns(T.nilable(::RBI::Type)) } + def proc_bind; end + + # source://rbi//lib/rbi/type.rb#391 + sig { returns(T::Hash[::Symbol, ::RBI::Type]) } + def proc_params; end + + # source://rbi//lib/rbi/type.rb#394 + sig { returns(::RBI::Type) } + def proc_returns; end + + # source://rbi//lib/rbi/type.rb#424 + sig { params(type: T.untyped).returns(T.self_type) } + def returns(type); end + + # source://rbi//lib/rbi/type.rb#442 + sig { override.returns(::String) } + def to_rbi; end + + # source://rbi//lib/rbi/type.rb#430 + sig { returns(T.self_type) } + def void; end +end + +# `T.self_type`. +# +# source://rbi//lib/rbi/type.rb#103 +class RBI::Type::SelfType < ::RBI::Type + # source://rbi//lib/rbi/type.rb#107 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#112 + sig { override.returns(::String) } + def to_rbi; end +end + +# A shape type like `{name: String, age: Integer}`. +# +# source://rbi//lib/rbi/type.rb#357 +class RBI::Type::Shape < ::RBI::Type + # source://rbi//lib/rbi/type.rb#364 + sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).void } + def initialize(types); end + + # source://rbi//lib/rbi/type.rb#370 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#375 + sig { override.returns(::String) } + def to_rbi; end + + # source://rbi//lib/rbi/type.rb#361 + sig { returns(T::Hash[T.any(::String, ::Symbol), ::RBI::Type]) } + def types; end +end + +# A type that represents a simple class name like `String` or `Foo`. +# +# It can also be a qualified name like `::Foo` or `Foo::Bar`. +# +# source://rbi//lib/rbi/type.rb#17 +class RBI::Type::Simple < ::RBI::Type + # source://rbi//lib/rbi/type.rb#24 + sig { params(name: ::String).void } + def initialize(name); end + + # source://rbi//lib/rbi/type.rb#30 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#21 + sig { returns(::String) } + def name; end + + # source://rbi//lib/rbi/type.rb#35 + sig { override.returns(::String) } + def to_rbi; end +end + +# A tuple type like `[String, Integer]`. +# +# source://rbi//lib/rbi/type.rb#333 +class RBI::Type::Tuple < ::RBI::Type + # source://rbi//lib/rbi/type.rb#340 + sig { params(types: T::Array[::RBI::Type]).void } + def initialize(types); end + + # source://rbi//lib/rbi/type.rb#346 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#351 + sig { override.returns(::String) } + def to_rbi; end + + # source://rbi//lib/rbi/type.rb#337 + sig { returns(T::Array[::RBI::Type]) } + def types; end +end + +# A type parameter like `T.type_parameter(:U)`. +# +# source://rbi//lib/rbi/type.rb#307 +class RBI::Type::TypeParameter < ::RBI::Type + # source://rbi//lib/rbi/type.rb#314 + sig { params(name: ::Symbol).void } + def initialize(name); end + + # source://rbi//lib/rbi/type.rb#320 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#311 + sig { returns(::Symbol) } + def name; end + + # source://rbi//lib/rbi/type.rb#325 + sig { override.returns(::String) } + def to_rbi; end +end + +# `T.untyped`. +# +# source://rbi//lib/rbi/type.rb#118 +class RBI::Type::Untyped < ::RBI::Type + # source://rbi//lib/rbi/type.rb#122 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#127 + sig { override.returns(::String) } + def to_rbi; end +end + +# source://rbi//lib/rbi/type_visitor.rb#6 +class RBI::Type::Visitor + # source://rbi//lib/rbi/type_visitor.rb#12 + sig { params(node: ::RBI::Type).void } + def visit(node); end + + private + + # source://rbi//lib/rbi/type_visitor.rb#58 + sig { params(type: ::RBI::Type::All).void } + def visit_all(type); end + + # source://rbi//lib/rbi/type_visitor.rb#61 + sig { params(type: ::RBI::Type::Any).void } + def visit_any(type); end + + # source://rbi//lib/rbi/type_visitor.rb#64 + sig { params(type: ::RBI::Type::Anything).void } + def visit_anything(type); end + + # source://rbi//lib/rbi/type_visitor.rb#67 + sig { params(type: ::RBI::Type::AttachedClass).void } + def visit_attached_class(type); end + + # source://rbi//lib/rbi/type_visitor.rb#70 + sig { params(type: ::RBI::Type::Boolean).void } + def visit_boolean(type); end + + # source://rbi//lib/rbi/type_visitor.rb#73 + sig { params(type: ::RBI::Type::Class).void } + def visit_class(type); end + + # source://rbi//lib/rbi/type_visitor.rb#76 + sig { params(type: ::RBI::Type::ClassOf).void } + def visit_class_of(type); end + + # source://rbi//lib/rbi/type_visitor.rb#79 + sig { params(type: ::RBI::Type::Generic).void } + def visit_generic(type); end + + # source://rbi//lib/rbi/type_visitor.rb#82 + sig { params(type: ::RBI::Type::Nilable).void } + def visit_nilable(type); end + + # source://rbi//lib/rbi/type_visitor.rb#88 + sig { params(type: ::RBI::Type::NoReturn).void } + def visit_no_return(type); end + + # source://rbi//lib/rbi/type_visitor.rb#91 + sig { params(type: ::RBI::Type::Proc).void } + def visit_proc(type); end + + # source://rbi//lib/rbi/type_visitor.rb#94 + sig { params(type: ::RBI::Type::SelfType).void } + def visit_self_type(type); end + + # source://rbi//lib/rbi/type_visitor.rb#100 + sig { params(type: ::RBI::Type::Shape).void } + def visit_shape(type); end + + # source://rbi//lib/rbi/type_visitor.rb#85 + sig { params(type: ::RBI::Type::Simple).void } + def visit_simple(type); end + + # source://rbi//lib/rbi/type_visitor.rb#103 + sig { params(type: ::RBI::Type::Tuple).void } + def visit_tuple(type); end + + # source://rbi//lib/rbi/type_visitor.rb#106 + sig { params(type: ::RBI::Type::TypeParameter).void } + def visit_type_parameter(type); end + + # source://rbi//lib/rbi/type_visitor.rb#109 + sig { params(type: ::RBI::Type::Untyped).void } + def visit_untyped(type); end + + # source://rbi//lib/rbi/type_visitor.rb#97 + sig { params(type: ::RBI::Type::Void).void } + def visit_void(type); end +end + +# source://rbi//lib/rbi/type_visitor.rb#9 +class RBI::Type::Visitor::Error < ::RBI::Error; end + +# `void`. +# +# source://rbi//lib/rbi/type.rb#133 +class RBI::Type::Void < ::RBI::Type + # source://rbi//lib/rbi/type.rb#137 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/type.rb#142 + sig { override.returns(::String) } + def to_rbi; end +end + # source://rbi//lib/rbi/model.rb#1400 class RBI::TypeMember < ::RBI::NodeWithComments include ::RBI::Indexable @@ -3081,18 +3881,18 @@ class RBI::Visibility < ::RBI::NodeWithComments def initialize(visibility, loc: T.unsafe(nil), comments: T.unsafe(nil)); end # source://rbi//lib/rbi/model.rb#932 - sig { params(other: ::RBI::Visibility).returns(T::Boolean) } + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/model.rb#947 + # source://rbi//lib/rbi/model.rb#949 sig { returns(T::Boolean) } def private?; end - # source://rbi//lib/rbi/model.rb#942 + # source://rbi//lib/rbi/model.rb#944 sig { returns(T::Boolean) } def protected?; end - # source://rbi//lib/rbi/model.rb#937 + # source://rbi//lib/rbi/model.rb#939 sig { returns(T::Boolean) } def public?; end @@ -3101,13 +3901,13 @@ class RBI::Visibility < ::RBI::NodeWithComments def visibility; end end -# source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#52 +# source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#52 class RBI::VisibilityGroup < ::RBI::Tree - # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#59 + # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#59 sig { params(visibility: ::RBI::Visibility).void } def initialize(visibility); end - # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#56 + # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#56 sig { returns(::RBI::Visibility) } def visibility; end end diff --git a/tapioca.gemspec b/tapioca.gemspec index c2a689b35..2a73e27e4 100644 --- a/tapioca.gemspec +++ b/tapioca.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.add_dependency("bundler", ">= 2.2.25") spec.add_dependency("netrc", ">= 0.11.0") spec.add_dependency("parallel", ">= 1.21.0") - spec.add_dependency("rbi", ">= 0.1.14", "< 0.2") + spec.add_dependency("rbi", "~> 0.2") spec.add_dependency("sorbet-static-and-runtime", ">= 0.5.11087") spec.add_dependency("spoom", ">= 1.2.0") spec.add_dependency("thor", ">= 1.2.0")