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

Suppress Lint/AmbiguousOperatorPrecedence offense #207

Merged
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
2 changes: 1 addition & 1 deletion lib/rubocop/ast/node.rb
Expand Up @@ -425,7 +425,7 @@ def loop_keyword?
end

def keyword?
return true if special_keyword? || send_type? && prefix_not?
return true if special_keyword? || (send_type? && prefix_not?)
return false unless KEYWORDS.include?(type)

!OPERATOR_KEYWORDS.include?(type) || loc.operator.is?(type.to_s)
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/ast/node_pattern/lexer_spec.rb
Expand Up @@ -67,7 +67,7 @@

it 'distinguishes them' do
types = tokens.map(&:first)
expect(types).to eq [:tNODE_TYPE] * 2 + [:tPARAM_CONST] * 7
expect(types).to eq ([:tNODE_TYPE] * 2) + ([:tPARAM_CONST] * 7)
zz, percent_zz = tokens.last(2).map(&:last).map(&:first)
expect(zz).to eq 'Zz'
expect(percent_zz).to eq 'Zz'
Expand Down