Method: Keisan::Tokens::BitwiseOperator#operator_type

Defined in:
lib/keisan/tokens/bitwise_operator.rb

#operator_typeObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/keisan/tokens/bitwise_operator.rb', line 15

def operator_type
  case string
  when AND
    :"&"
  when OR
    :"|"
  when XOR
    :"^"
  when NOT
    string.count("~").even? ? :"~~" : :"~"
  end
end