(row map[string]ValueInterface, conditionExpression *ast.ConditionExpression, commandName string)
| 686 | } |
| 687 | |
| 688 | func processConditionExpression(row map[string]ValueInterface, conditionExpression *ast.ConditionExpression, commandName string) (bool, error) { |
| 689 | valueLeft, err := getTifierValue(conditionExpression.Left, row) |
| 690 | if err != nil { |
| 691 | return false, err |
| 692 | } |
| 693 | |
| 694 | valueRight, err := getTifierValue(conditionExpression.Right, row) |
| 695 | if err != nil { |
| 696 | return false, err |
| 697 | } |
| 698 | |
| 699 | switch conditionExpression.Condition.Type { |
| 700 | case token.EQUAL: |
| 701 | return valueLeft.IsEqual(valueRight), nil |
| 702 | case token.NOT: |
| 703 | return !(valueLeft.IsEqual(valueRight)), nil |
| 704 | default: |
| 705 | return false, &UnsupportedConditionalTokenError{variable: conditionExpression.Condition.Literal, commandName: commandName} |
| 706 | } |
| 707 | } |
| 708 | |
| 709 | func processContainExpression(row map[string]ValueInterface, containExpression *ast.ContainExpression) (bool, error) { |
| 710 | valueLeft, err := getTifierValue(containExpression.Left, row) |
no test coverage detected