diff --git a/lib/rubocop/ast/processed_source.rb b/lib/rubocop/ast/processed_source.rb index 566e5d343..66656d71e 100644 --- a/lib/rubocop/ast/processed_source.rb +++ b/lib/rubocop/ast/processed_source.rb @@ -41,7 +41,7 @@ def initialize(source, ruby_version, path = nil) def ast_with_comments return if !ast || !comments - @ast_with_comments ||= Parser::Source::Comment.associate(ast, comments) + @ast_with_comments ||= Parser::Source::Comment.associate_by_identity(ast, comments) end # Returns the source lines, line break characters removed, excluding a diff --git a/rubocop-ast.gemspec b/rubocop-ast.gemspec index 607954c68..2151cf112 100644 --- a/rubocop-ast.gemspec +++ b/rubocop-ast.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |s| 'bug_tracker_uri' => 'https://github.com/rubocop-hq/rubocop-ast/issues' } - s.add_runtime_dependency('parser', '>= 2.7.1.5') + s.add_runtime_dependency('parser', '>= 3.0.1.1') s.add_development_dependency('bundler', '>= 1.15.0', '< 3.0')