Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
259 changes: 0 additions & 259 deletions lib/prism/node_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading
Loading