MCPcopy Index your code
hub / github.com/python/cpython / maybe

Method maybe

Tools/cases_generator/plexer.py:47–52  ·  view source on GitHub ↗
(self, kind: str, raw: bool = False)

Source from the content-addressed store, hash-verified

45 return tok
46
47 def maybe(self, kind: str, raw: bool = False) -> Token | None:
48 # Return next token without advancing position if kind matches
49 tok = self.peek(raw=raw)
50 if tok and tok.kind == kind:
51 return tok
52 return None
53
54 def expect(self, kind: str) -> Token | None:
55 # Return next token and advance position if kind matches

Callers

nothing calls this directly

Calls 1

peekMethod · 0.95

Tested by

no test coverage detected