MCPcopy Create free account
hub / github.com/LissaGreense/GO4SQL / getOperationExpression

Method getOperationExpression

parser/parser.go:785–805  ·  view source on GitHub ↗

getOperationExpression - Return ast.OperationExpression created from tokens and validate the syntax

(expression ast.Expression)

Source from the content-addressed store, hash-verified

783
784// getOperationExpression - Return ast.OperationExpression created from tokens and validate the syntax
785func (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
808func (parser *Parser) getConditionalExpression(leftSide token.Token, isAnonymitifier bool) (bool, *ast.ConditionExpression, error) {

Callers 1

getExpressionMethod · 0.95

Calls 2

nextTokenMethod · 0.95
getExpressionMethod · 0.95

Tested by

no test coverage detected