diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb index 4457c26fbe..8a5691848f 100644 --- a/lib/prism/node_ext.rb +++ b/lib/prism/node_ext.rb @@ -176,20 +176,6 @@ class RationalNode < Node def value Rational(numerator, denominator) end - - # Returns the value of the node as an IntegerNode or a FloatNode. This - # method is deprecated in favor of #value or #numerator/#denominator. - #-- - #: () -> (IntegerNode | FloatNode) - def numeric - deprecated("value", "numerator", "denominator") - - if denominator == 1 - IntegerNode.new(source, -1, location.chop, flags, numerator) - else - FloatNode.new(source, -1, location.chop, 0, numerator.to_f / denominator) - end - end end class ConstantReadNode < Node @@ -271,21 +257,6 @@ def full_name_parts def full_name full_name_parts.join("::") 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. - #-- - #: () -> (ConstantReadNode | MissingNode) - def child - deprecated("name", "name_loc") - - if (name = self.name) - ConstantReadNode.new(source, -1, name_loc, 0, name) - else - MissingNode.new(source, -1, location, 0) - end - end end class ConstantPathTargetNode < Node @@ -318,21 +289,6 @@ def full_name_parts def full_name full_name_parts.join("::") 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. - #-- - #: () -> (ConstantReadNode | MissingNode) - def child - deprecated("name", "name_loc") - - if (name = self.name) - ConstantReadNode.new(source, -1, name_loc, 0, name) - else - MissingNode.new(source, -1, location, 0) - end - end end class ConstantTargetNode < Node @@ -432,219 +388,4 @@ def full_message_loc attribute_write? ? message_loc&.adjoin("=") : message_loc end end - - class CallOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - #-- - #: () -> Symbol - def operator - deprecated("binary_operator") - binary_operator - end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - #-- - #: () -> Location - def operator_loc - deprecated("binary_operator_loc") - binary_operator_loc - end - end - - class ClassVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - #-- - #: () -> Symbol - def operator - deprecated("binary_operator") - binary_operator - end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - #-- - #: () -> Location - def operator_loc - deprecated("binary_operator_loc") - binary_operator_loc - end - end - - class ConstantOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - #-- - #: () -> Symbol - def operator - deprecated("binary_operator") - binary_operator - end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - #-- - #: () -> Location - def operator_loc - deprecated("binary_operator_loc") - binary_operator_loc - end - end - - class ConstantPathOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - #-- - #: () -> Symbol - def operator - deprecated("binary_operator") - binary_operator - end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - #-- - #: () -> Location - def operator_loc - deprecated("binary_operator_loc") - binary_operator_loc - end - end - - class GlobalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - #-- - #: () -> Symbol - def operator - deprecated("binary_operator") - binary_operator - end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - #-- - #: () -> Location - def operator_loc - deprecated("binary_operator_loc") - binary_operator_loc - end - end - - class IndexOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - #-- - #: () -> Symbol - def operator - deprecated("binary_operator") - binary_operator - end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - #-- - #: () -> Location - def operator_loc - deprecated("binary_operator_loc") - binary_operator_loc - end - end - - class InstanceVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - #-- - #: () -> Symbol - def operator - deprecated("binary_operator") - binary_operator - end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - #-- - #: () -> Location - def operator_loc - deprecated("binary_operator_loc") - binary_operator_loc - end - end - - class LocalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - #-- - #: () -> Symbol - def operator - deprecated("binary_operator") - binary_operator - end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - #-- - #: () -> Location - def operator_loc - deprecated("binary_operator_loc") - binary_operator_loc - end - end - - class CaseMatchNode < Node - # Returns the else clause of the case match node. This method is deprecated - # in favor of #else_clause. - #-- - #: () -> ElseNode? - def consequent - deprecated("else_clause") - else_clause - end - end - - class CaseNode < Node - # Returns the else clause of the case node. This method is deprecated in - # favor of #else_clause. - #-- - #: () -> ElseNode? - def consequent - deprecated("else_clause") - else_clause - end - end - - class IfNode < Node - # Returns the subsequent if/elsif/else clause of the if node. This method is - # deprecated in favor of #subsequent. - #-- - #: () -> (IfNode | ElseNode)? - def consequent - deprecated("subsequent") - subsequent - end - end - - class RescueNode < Node - # Returns the subsequent rescue clause of the rescue node. This method is - # deprecated in favor of #subsequent. - #-- - #: () -> RescueNode? - def consequent - deprecated("subsequent") - subsequent - end - end - - class UnlessNode < Node - # Returns the else clause of the unless node. This method is deprecated in - # favor of #else_clause. - #-- - #: () -> ElseNode? - def consequent - deprecated("else_clause") - else_clause - end - end end diff --git a/rbi/generated/prism/node_ext.rbi b/rbi/generated/prism/node_ext.rbi index 25255d073b..3177dca76f 100644 --- a/rbi/generated/prism/node_ext.rbi +++ b/rbi/generated/prism/node_ext.rbi @@ -93,11 +93,6 @@ module Prism # Returns the value of the node as a Ruby Rational. sig { returns(Rational) } def value; end - - # Returns the value of the node as an IntegerNode or a FloatNode. This - # method is deprecated in favor of #value or #numerator/#denominator. - sig { returns(::T.any(IntegerNode, FloatNode)) } - def numeric; end end class ConstantReadNode < Node @@ -144,12 +139,6 @@ module Prism # Returns the full name of this constant path. For example: "Foo::Bar" sig { returns(String) } def full_name; end - - # Previously, we had a child node on this class that contained either a - # constant read or a missing node. To not cause a breaking change, we - # continue to supply that API. - sig { returns(::T.any(ConstantReadNode, MissingNode)) } - def child; end end class ConstantPathTargetNode < Node @@ -161,12 +150,6 @@ module Prism # Returns the full name of this constant path. For example: "Foo::Bar" sig { returns(String) } def full_name; end - - # Previously, we had a child node on this class that contained either a - # constant read or a missing node. To not cause a breaking change, we - # continue to supply that API. - sig { returns(::T.any(ConstantReadNode, MissingNode)) } - def child; end end class ConstantTargetNode < Node @@ -199,135 +182,4 @@ module Prism sig { returns(::T.nilable(Location)) } def full_message_loc; end end - - class CallOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class ClassVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class ConstantOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class ConstantPathOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class GlobalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class IndexOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class InstanceVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class LocalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class CaseMatchNode < Node - # Returns the else clause of the case match node. This method is deprecated - # in favor of #else_clause. - sig { returns(::T.nilable(ElseNode)) } - def consequent; end - end - - class CaseNode < Node - # Returns the else clause of the case node. This method is deprecated in - # favor of #else_clause. - sig { returns(::T.nilable(ElseNode)) } - def consequent; end - end - - class IfNode < Node - # Returns the subsequent if/elsif/else clause of the if node. This method is - # deprecated in favor of #subsequent. - sig { returns(::T.nilable(::T.any(IfNode, ElseNode))) } - def consequent; end - end - - class RescueNode < Node - # Returns the subsequent rescue clause of the rescue node. This method is - # deprecated in favor of #subsequent. - sig { returns(::T.nilable(RescueNode)) } - def consequent; end - end - - class UnlessNode < Node - # Returns the else clause of the unless node. This method is deprecated in - # favor of #else_clause. - sig { returns(::T.nilable(ElseNode)) } - def consequent; end - end end diff --git a/sig/generated/prism/node_ext.rbs b/sig/generated/prism/node_ext.rbs index 273e591eb8..db2be11684 100644 --- a/sig/generated/prism/node_ext.rbs +++ b/sig/generated/prism/node_ext.rbs @@ -109,12 +109,6 @@ module Prism # -- # : () -> Rational def value: () -> Rational - - # Returns the value of the node as an IntegerNode or a FloatNode. This - # method is deprecated in favor of #value or #numerator/#denominator. - # -- - # : () -> (IntegerNode | FloatNode) - def numeric: () -> (IntegerNode | FloatNode) end class ConstantReadNode < Node @@ -169,13 +163,6 @@ module Prism # -- # : () -> String def full_name: () -> String - - # Previously, we had a child node on this class that contained either a - # constant read or a missing node. To not cause a breaking change, we - # continue to supply that API. - # -- - # : () -> (ConstantReadNode | MissingNode) - def child: () -> (ConstantReadNode | MissingNode) end class ConstantPathTargetNode < Node @@ -189,13 +176,6 @@ module Prism # -- # : () -> String def full_name: () -> String - - # Previously, we had a child node on this class that contained either a - # constant read or a missing node. To not cause a breaking change, we - # continue to supply that API. - # -- - # : () -> (ConstantReadNode | MissingNode) - def child: () -> (ConstantReadNode | MissingNode) end class ConstantTargetNode < Node @@ -232,156 +212,4 @@ module Prism # : () -> Location? def full_message_loc: () -> Location? end - - class CallOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class ClassVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class ConstantOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class ConstantPathOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class GlobalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class IndexOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class InstanceVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class LocalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class CaseMatchNode < Node - # Returns the else clause of the case match node. This method is deprecated - # in favor of #else_clause. - # -- - # : () -> ElseNode? - def consequent: () -> ElseNode? - end - - class CaseNode < Node - # Returns the else clause of the case node. This method is deprecated in - # favor of #else_clause. - # -- - # : () -> ElseNode? - def consequent: () -> ElseNode? - end - - class IfNode < Node - # Returns the subsequent if/elsif/else clause of the if node. This method is - # deprecated in favor of #subsequent. - # -- - # : () -> (IfNode | ElseNode)? - def consequent: () -> (IfNode | ElseNode)? - end - - class RescueNode < Node - # Returns the subsequent rescue clause of the rescue node. This method is - # deprecated in favor of #subsequent. - # -- - # : () -> RescueNode? - def consequent: () -> RescueNode? - end - - class UnlessNode < Node - # Returns the else clause of the unless node. This method is deprecated in - # favor of #else_clause. - # -- - # : () -> ElseNode? - def consequent: () -> ElseNode? - end end