Consume and return the current token.
(self)
| 183 | return False |
| 184 | |
| 185 | def advance(self) -> Token: |
| 186 | """Consume and return the current token.""" |
| 187 | token = self.current() |
| 188 | if not self.at_end(): |
| 189 | self.pos += 1 |
| 190 | return token |
| 191 | |
| 192 | def consume(self, token_type: TokenType, message: str = None) -> Token: |
| 193 | """Consume a token of the expected type, or raise an error.""" |
no test coverage detected