Class: TEALrb::Rewriters::ComparisonRewriter

Inherits:
Rewriter
  • Object
show all
Defined in:
lib/tealrb/rewriters.rb

Instance Attribute Summary

Attributes inherited from Rewriter

#contract

Instance Method Summary collapse

Methods inherited from Rewriter

#rewrite

Instance Method Details

#on_send(node) ⇒ Object



84
85
86
87
88
89
# File 'lib/tealrb/rewriters.rb', line 84

def on_send(node)
  if TEALrb::Opcodes::BINARY_OPCODE_METHOD_MAPPING.keys.map(&:to_s).include? node.loc.selector.source
    wrap(node.source_range, '(', ')')
  end
  super
end