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

Method forced_atom

Tools/peg_generator/pegen/grammar_parser.py:395–411  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

393
394 @memoize
395 def forced_atom(self) -> Optional[Forced]:
396 # forced_atom: '&' '&' ~ atom
397 mark = self._mark()
398 cut = False
399 if (
400 (literal := self.expect('&'))
401 and
402 (literal_1 := self.expect('&'))
403 and
404 (cut := True)
405 and
406 (atom := self.atom())
407 ):
408 return Forced ( atom )
409 self._reset(mark)
410 if cut: return None
411 return None
412
413 @memoize
414 def lookahead(self) -> Optional[LookaheadOrCut]:

Callers 1

named_itemMethod · 0.95

Calls 4

atomMethod · 0.95
ForcedClass · 0.90
expectMethod · 0.45
_resetMethod · 0.45

Tested by

no test coverage detected