MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / matchType

Method matchType

pkg/sql/parser/parser.go:887–893  ·  view source on GitHub ↗

matchType checks if the current token's Type matches the expected type and advances if so.

(expected models.TokenType)

Source from the content-addressed store, hash-verified

885
886// matchType checks if the current token's Type matches the expected type and advances if so.
887func (p *Parser) matchType(expected models.TokenType) bool {
888 if p.currentToken.Token.Type == expected {
889 p.advance()
890 return true
891 }
892 return false
893}
894
895// isAnyType checks if the current token's Type matches any of the given types.
896// More efficient than multiple isType calls when checking many alternatives.

Callers 7

parseAlterStatementMethod · 0.95
parseRoleOptionMethod · 0.95
TestMatchTypeFunction · 0.95

Calls 1

advanceMethod · 0.95

Tested by 1

TestMatchTypeFunction · 0.76