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

Method macro_def

Tools/cases_generator/parsing.py:510–520  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

508
509 @contextual
510 def macro_def(self) -> Macro | None:
511 if tkn := self.expect(lx.MACRO):
512 if self.expect(lx.LPAREN):
513 if tkn := self.expect(lx.IDENTIFIER):
514 if self.expect(lx.RPAREN):
515 if self.expect(lx.EQUALS):
516 if uops := self.uops():
517 self.require(lx.SEMI)
518 res = Macro(tkn.text, uops)
519 return res
520 return None
521
522 def uops(self) -> list[UOp] | None:
523 if uop := self.uop():

Callers 1

definitionMethod · 0.95

Calls 4

expectMethod · 0.95
uopsMethod · 0.95
MacroClass · 0.85
requireMethod · 0.80

Tested by

no test coverage detected