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

Method action

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

Source from the content-addressed store, hash-verified

530
531 @memoize
532 def action(self) -> Optional[str]:
533 # action: "{" ~ target_atoms "}"
534 mark = self._mark()
535 cut = False
536 if (
537 (literal := self.expect("{"))
538 and
539 (cut := True)
540 and
541 (target_atoms := self.target_atoms())
542 and
543 (literal_1 := self.expect("}"))
544 ):
545 return target_atoms
546 self._reset(mark)
547 if cut: return None
548 return None
549
550 @memoize
551 def annotation(self) -> Optional[str]:

Callers 1

altMethod · 0.95

Calls 3

target_atomsMethod · 0.95
expectMethod · 0.45
_resetMethod · 0.45

Tested by

no test coverage detected