isAnyType checks if the current token's Type matches any of the given types. More efficient than multiple isType calls when checking many alternatives.
(types ...models.TokenType)
| 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. |
| 897 | func (p *Parser) isAnyType(types ...models.TokenType) bool { |
| 898 | for _, t := range types { |
| 899 | if p.isType(t) { |
| 900 | return true |
| 901 | } |
| 902 | } |
| 903 | return false |
| 904 | } |
| 905 | |
| 906 | // isIdentifier checks if the current token is an identifier. |
| 907 | // Includes both regular identifiers and double-quoted identifiers. |