Module: DhallishGrammar::MultDivExpression2

Defined in:
lib/DhallishGrammar.rb

Instance Method Summary collapse

Instance Method Details

#to_nodeObject



3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
# File 'lib/DhallishGrammar.rb', line 3981

def to_node()
	tail.elements.reduce(exp.to_node()) { |tree, node|
		exp = node.exp.to_node()
		if node.op.text_value == "*"
			Dhallish::Ast::BinaryArithOpNode.new(Dhallish::Types::Numbers, tree, exp, "*") { |x, y| x * y }
		else
			Dhallish::Ast::BinaryArithOpNode.new([Dhallish::Types::Double, Dhallish::Types::Integer], tree, exp, "/") { |x, y| x / y }
		end

	}
end