Browse Source

Fix node type checks in arithmetic expressions.

pull/27/head
Julius Volz 12 years ago
parent
commit
fdf9a3aab7
  1. 8
      rules/ast/ast.go

8
rules/ast/ast.go

@ -540,13 +540,17 @@ func NewFunctionCall(function *Function, args []Node) (Node, error) {
func nodesHaveTypes(nodes []Node, exprTypes []ExprType) bool {
for _, node := range nodes {
correctType := false
for _, exprType := range exprTypes {
if node.Type() == exprType {
return true
correctType = true
}
}
if !correctType {
return false
}
}
return false
return true
}
func NewArithExpr(opType BinOpType, lhs Node, rhs Node) (Node, error) {

Loading…
Cancel
Save