(self, *choices)
| 111 | # Public methods. |
| 112 | |
| 113 | def check_token(self, *choices): |
| 114 | # Check if the next token is one of the given types. |
| 115 | while self.need_more_tokens(): |
| 116 | self.fetch_more_tokens() |
| 117 | if self.tokens: |
| 118 | if not choices: |
| 119 | return True |
| 120 | for choice in choices: |
| 121 | if isinstance(self.tokens[0], choice): |
| 122 | return True |
| 123 | return False |
| 124 | |
| 125 | def peek_token(self): |
| 126 | # Return the next token, but do not delete if from the queue. |
no test coverage detected