diff --git a/CHANGELOG.md b/CHANGELOG.md index e7fa72123..3ef4ad28c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * [#31](https://github.com/rubocop-hq/rubocop-ast/pull/31): NodePattern now uses `param === node` to match params, which allows Regexp, Proc, Set in addition to Nodes and literals. ([@marcandre][]) * [#41](https://github.com/rubocop-hq/rubocop-ast/pull/41): Add `delimiters` and related predicates for `RegexpNode`. ([@owst][]) * [#46](https://github.com/rubocop-hq/rubocop-ast/pull/46): Basic support for [non-legacy AST output from parser](https://github.com/whitequark/parser/#usage). Note that there is no support (yet) in main RuboCop gem. ([@marcandre][]) +* [#48](https://github.com/rubocop-hq/rubocop-ast/pull/48): Support `Parser::Ruby28` for Ruby 2.8 (3.0) parser. ([@koic][]) ## 0.0.3 (2020-05-15) diff --git a/lib/rubocop/ast/processed_source.rb b/lib/rubocop/ast/processed_source.rb index cc58f2ed5..212ccd1c5 100644 --- a/lib/rubocop/ast/processed_source.rb +++ b/lib/rubocop/ast/processed_source.rb @@ -2,6 +2,7 @@ require 'digest/sha1' +# rubocop:disable Metrics/ClassLength module RuboCop module AST # ProcessedSource contains objects which are generated by Parser @@ -176,6 +177,9 @@ def parser_class(ruby_version) when 2.7 require 'parser/ruby27' Parser::Ruby27 + when 2.8 + require 'parser/ruby28' + Parser::Ruby28 else raise ArgumentError, "RuboCop found unknown Ruby version: #{ruby_version.inspect}" @@ -201,3 +205,4 @@ def create_parser(ruby_version) end end end +# rubocop:enable Metrics/ClassLength