End previousTokenIs peekTokenIs checks if the Parser's peekToken is any of the given token types
(tokens ...token.Type)
| 133 | } // End previousTokenIs |
| 134 | // peekTokenIs checks if the Parser's peekToken is any of the given token types |
| 135 | func (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 |
| 148 | func (p *Parser) Error() error { |
no outgoing calls
no test coverage detected