From 76a704cc40d2d9b7df134bd4816e590803e3212b Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 17 Mar 2024 03:36:05 +0900 Subject: [PATCH] Use `AST::Processor::Mixin` instead of deprecated `AST::Processor` (#1000) This PR uses `AST::Processor::Mixin` instead of deprecated `AST::Processor` API: ```ruby # This class includes {AST::Processor::Mixin}; however, it is # deprecated, since the module defines all of the behaviors that # the processor includes. Any new libraries should use # {AST::Processor::Mixin} instead of subclassing this. # # @deprecated Use {AST::Processor::Mixin} instead. ``` https://github.com/whitequark/ast/blob/v2.4.2/lib/ast/processor.rb#L2-L7 There is an imcompatibility where the inheritance no longer includes `AST::Processor`, but the impact is expected to be negligible. --- lib/parser/ast/processor.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/parser/ast/processor.rb b/lib/parser/ast/processor.rb index fe65b4cca..9636c43e6 100644 --- a/lib/parser/ast/processor.rb +++ b/lib/parser/ast/processor.rb @@ -6,7 +6,9 @@ module AST ## # @api public # - class Processor < ::AST::Processor + class Processor + include ::AST::Processor::Mixin + def process_regular_node(node) node.updated(nil, process_all(node)) end