module Q::Monomial2

Public Instance Methods

eval(scope) click to toggle source
# File lib/q/parser.rb, line 799
def eval scope
  if has_feet?
    feet = tail.elements.first.feet
    return operator.apply(scope, head, feet)
  end

  scope['_'] = head.eval(scope)
end
has_feet?() click to toggle source
# File lib/q/parser.rb, line 808
def has_feet?
  not tail.nil? and not tail.elements.first.nil? and not tail.elements.first.feet.nil?
end
operator() click to toggle source
# File lib/q/parser.rb, line 812
def operator
  return nil if not has_feet?

  tail.elements.first.operator
end