MCPcopy Create free account
hub / github.com/rthalley/dnspython / get_remaining

Method get_remaining

dns/tokenizer.py:599–616  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
ungetMethod · 0.95
is_eol_or_eofMethod · 0.80

Tested by

no test coverage detected