From 45f32e3a50c71dbcb9969a2d379783e50eab772f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 28 Aug 2024 15:07:09 -0400 Subject: [PATCH] [ruby/prism] Reverse-sync ruby/ruby and deprecate old fields https://github.com/ruby/prism/commit/bc21c9f3ee --- lib/prism/node_ext.rb | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) 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