MCPcopy Index your code
hub / github.com/LissaGreense/GO4SQL / validateTokenAndSkip

Function validateTokenAndSkip

parser/parser.go:37–47  ·  view source on GitHub ↗

validateTokenAndSkip - Check if current token type is appearing in provided expectedTokens array then move to the next token

(parser *Parser, expectedTokens []token.Type)

Source from the content-addressed store, hash-verified

35
36// validateTokenAndSkip - Check if current token type is appearing in provided expectedTokens array then move to the next token
37func validateTokenAndSkip(parser *Parser, expectedTokens []token.Type) error {
38 err := validateToken(parser.currentToken.Type, expectedTokens)
39
40 if err != nil {
41 return err
42 }
43
44 // Ignore validated token
45 parser.nextToken()
46 return nil
47}
48
49// validateToken - Check if current token type is appearing in provided expectedTokens array
50func validateToken(tokenType token.Type, expectedTokens []token.Type) error {

Callers 9

parseCreateCommandMethod · 0.85
parseInsertCommandMethod · 0.85
parseSelectCommandMethod · 0.85
parseDeleteCommandMethod · 0.85
parseDropCommandMethod · 0.85
parseOrderByCommandMethod · 0.85
parseJoinCommandMethod · 0.85
parseUpdateCommandMethod · 0.85
getContainExpressionMethod · 0.85

Calls 2

validateTokenFunction · 0.85
nextTokenMethod · 0.80

Tested by

no test coverage detected