Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Parser::Ruby28 #48

Merged
merged 1 commit into from Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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)

Expand Down
5 changes: 5 additions & 0 deletions lib/rubocop/ast/processed_source.rb
Expand Up @@ -2,6 +2,7 @@

require 'digest/sha1'

# rubocop:disable Metrics/ClassLength
module RuboCop
module AST
# ProcessedSource contains objects which are generated by Parser
Expand Down Expand Up @@ -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}"
Expand All @@ -201,3 +205,4 @@ def create_parser(ruby_version)
end
end
end
# rubocop:enable Metrics/ClassLength