summaryrefslogtreecommitdiff
path: root/lib/prism
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-08-28 15:07:09 -0400
committergit <[email protected]>2024-08-28 19:07:16 +0000
commit45f32e3a50c71dbcb9969a2d379783e50eab772f (patch)
tree80b7c694f8d4c2c9da12592fa52d8a0405cb1d12 /lib/prism
parent417bb8d4fd7f197d2cbe8223e9666e3a41896d75 (diff)
[ruby/prism] Reverse-sync ruby/ruby and deprecate old fields
https://github.com/ruby/prism/commit/bc21c9f3ee
Diffstat (limited to 'lib/prism')
-rw-r--r--lib/prism/node_ext.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb
index 354bfdb205..4dfcebd638 100644
--- a/lib/prism/node_ext.rb
+++ b/lib/prism/node_ext.rb
@@ -460,4 +460,49 @@ module Prism
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.
+ 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.
+ 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.
+ 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.
+ 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.
+ def consequent
+ deprecated("else_clause")
+ else_clause
+ end
+ end
end