MCPcopy Create free account
hub / github.com/Permify/permify / currentTokenIs

Method currentTokenIs

pkg/dsl/parser/parser.go:113–123  ·  view source on GitHub ↗

currentTokenIs checks if the Parser's currentToken is any of the given token types

(tokens ...token.Type)

Source from the content-addressed store, hash-verified

111
112// currentTokenIs checks if the Parser's currentToken is any of the given token types
113func (p *Parser) currentTokenIs(tokens ...token.Type) bool {
114 // iterate through the given token types and check if any of them match the currentToken's type
115 for _, t := range tokens {
116 if p.currentToken.Type == t {
117 // if a match is found, return true
118 return true
119 }
120 }
121 // if no match is found, return false
122 return false
123}
124
125// previousTokenIs checks if the Parser's previousToken type matches any of the given types
126func (p *Parser) previousTokenIs(tokens ...token.Type) bool { // Check if previous token matches any type

Callers 7

ParseMethod · 0.95
ParsePartialMethod · 0.95
parseEntityStatementMethod · 0.95
parseExpressionMethod · 0.95
parseIdentifierOrCallMethod · 0.95
parseCallExpressionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected