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

Method peekTokenIs

pkg/dsl/parser/parser.go:135–145  ·  view source on GitHub ↗

End previousTokenIs peekTokenIs checks if the Parser's peekToken is any of the given token types

(tokens ...token.Type)

Source from the content-addressed store, hash-verified

133} // End previousTokenIs
134// peekTokenIs checks if the Parser's peekToken is any of the given token types
135func (p *Parser) peekTokenIs(tokens ...token.Type) bool {
136 // iterate through the given token types and check if any of them match the peekToken's type
137 for _, t := range tokens {
138 if p.peekToken.Type == t {
139 // if a match is found, return true
140 return true
141 }
142 }
143 // if no match is found, return false
144 return false
145}
146
147// Error returns an error if there are any errors in the Parser's errors slice
148func (p *Parser) Error() error {

Callers 10

parseRuleStatementMethod · 0.95
expectAndNextMethod · 0.95
expectMethod · 0.95
parseExpressionMethod · 0.95
parseIdentifierOrCallMethod · 0.95
parseCallExpressionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected