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

Method getExpressionLeftSideValue

parser/parser.go:755–782  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

753}
754
755func (parser *Parser) getExpressionLeftSideValue() (token.Token, bool, error) {
756 var leftSide token.Token
757 isAnonymitifier := false
758 startedWithApostrophe := parser.skipIfCurrentTokenIsApostrophe()
759
760 if startedWithApostrophe {
761 isAnonymitifier = true
762 value := ""
763 for parser.currentToken.Type != token.EOF && parser.currentToken.Type != token.APOSTROPHE {
764 value += parser.currentToken.Literal
765 parser.nextToken()
766 }
767
768 leftSide = token.Token{Type: token.IDENT, Literal: value}
769
770 finishedWithApostrophe := parser.skipIfCurrentTokenIsApostrophe()
771
772 err := validateApostropheWrapping(startedWithApostrophe, finishedWithApostrophe, leftSide)
773
774 if err != nil {
775 return token.Token{}, isAnonymitifier, err
776 }
777 } else {
778 leftSide = parser.currentToken
779 parser.nextToken()
780 }
781 return leftSide, isAnonymitifier, nil
782}
783
784// getOperationExpression - Return ast.OperationExpression created from tokens and validate the syntax
785func (parser *Parser) getOperationExpression(expression ast.Expression) (bool, *ast.OperationExpression, error) {

Callers 1

getExpressionMethod · 0.95

Calls 3

nextTokenMethod · 0.95

Tested by

no test coverage detected