Method: NScript::OpNode#compile_node

Defined in:
lib/nscript/parser/nodes.rb

#compile_node(o) ⇒ Object



530
531
532
533
534
535
536
# File 'lib/nscript/parser/nodes.rb', line 530

def compile_node(o)
  return write(compile_chain(o)) if chainable? && @first.unwrap.is_a?(OpNode) && @first.unwrap.chainable?
  return write(compile_assignment(o)) if ASSIGNMENT.include?(@operator.to_sym)
  return write(compile_unary(o)) if unary?
  return write(compile_existence(o)) if @operator == '?'
  write("#{@first.compile(o)} #{@operator} #{@second.compile(o)}")
end