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

Method previousTokenIs

pkg/dsl/parser/parser.go:126–133  ·  view source on GitHub ↗

previousTokenIs checks if the Parser's previousToken type matches any of the given types

(tokens ...token.Type)

Source from the content-addressed store, hash-verified

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
127 for _, tokenType := range tokens { // Iterate through token types
128 if p.previousToken.Type == tokenType { // Check for match
129 return true // Match found
130 } // Continue if no match
131 } // All types checked
132 return false // No match found
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

Callers 1

parseExpressionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected