getOperationExpression - Return ast.OperationExpression created from tokens and validate the syntax
(expression ast.Expression)
| 783 | |
| 784 | // getOperationExpression - Return ast.OperationExpression created from tokens and validate the syntax |
| 785 | func (parser *Parser) getOperationExpression(expression ast.Expression) (bool, *ast.OperationExpression, error) { |
| 786 | operationExpression := &ast.OperationExpression{} |
| 787 | operationExpression.Left = expression |
| 788 | |
| 789 | operationExpression.Operation = parser.currentToken |
| 790 | parser.nextToken() |
| 791 | |
| 792 | expressionIsValid, expression, err := parser.getExpression() |
| 793 | |
| 794 | if err != nil { |
| 795 | return false, nil, err |
| 796 | } |
| 797 | |
| 798 | if !expressionIsValid { |
| 799 | return false, nil, &LogicalExpressionParsingError{afterToken: &operationExpression.Operation.Literal} |
| 800 | } |
| 801 | |
| 802 | operationExpression.Right = expression |
| 803 | |
| 804 | return true, operationExpression, nil |
| 805 | } |
| 806 | |
| 807 | // getConditionalExpression - Return ast.ConditionExpression created from tokens and validate the syntax |
| 808 | func (parser *Parser) getConditionalExpression(leftSide token.Token, isAnonymitifier bool) (bool, *ast.ConditionExpression, error) { |
no test coverage detected