Skip to content

Commit

Permalink
Use AST::Processor::Mixin instead of deprecated AST::Processor (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
koic authored Mar 16, 2024
1 parent b920c87 commit 76a704c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/parser/ast/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76a704c

Please sign in to comment.