Return the remaining tokens on the line, until an EOL or EOF is seen. max_tokens: If not None, stop after this number of tokens. Returns a list of tokens.
(self, max_tokens: int | None = None)
| 597 | return token.value |
| 598 | |
| 599 | def get_remaining(self, max_tokens: int | None = None) -> List[Token]: |
| 600 | """Return the remaining tokens on the line, until an EOL or EOF is seen. |
| 601 | |
| 602 | max_tokens: If not None, stop after this number of tokens. |
| 603 | |
| 604 | Returns a list of tokens. |
| 605 | """ |
| 606 | |
| 607 | tokens = [] |
| 608 | while True: |
| 609 | token = self.get() |
| 610 | if token.is_eol_or_eof(): |
| 611 | self.unget(token) |
| 612 | break |
| 613 | tokens.append(token) |
| 614 | if len(tokens) == max_tokens: |
| 615 | break |
| 616 | return tokens |
| 617 | |
| 618 | def concatenate_remaining_identifiers(self, allow_empty: bool = False) -> str: |
| 619 | """Read the remaining tokens on the line, which should be identifiers. |
nothing calls this directly
no test coverage detected