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

Method rulename

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

Source from the content-addressed store, hash-verified

202
203 @memoize
204 def rulename(self) -> Optional[RuleName]:
205 # rulename: NAME annotation | NAME
206 mark = self._mark()
207 if (
208 (name := self.name())
209 and
210 (annotation := self.annotation())
211 ):
212 return ( name . string , annotation )
213 self._reset(mark)
214 if (
215 (name := self.name())
216 ):
217 return ( name . string , None )
218 self._reset(mark)
219 return None
220
221 @memoize
222 def flags(self) -> Optional[frozenset [str]]:

Callers 1

ruleMethod · 0.95

Calls 3

annotationMethod · 0.95
nameMethod · 0.45
_resetMethod · 0.45

Tested by

no test coverage detected