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

Method visitFieldDeclaration

Parser/asdl_c.py:619–629  ·  view source on GitHub ↗
(self, field, name, sum=None, prod=None, depth=0)

Source from the content-addressed store, hash-verified

617 self.emit("", 0)
618
619 def visitFieldDeclaration(self, field, name, sum=None, prod=None, depth=0):
620 ctype = get_c_type(field.type)
621 if field.seq:
622 if self.isSimpleType(field):
623 self.emit("asdl_int_seq* %s;" % field.name, depth)
624 else:
625 _type = field.type
626 self.emit(f"asdl_{field.type}_seq* {field.name};", depth)
627 else:
628 ctype = get_c_type(field.type)
629 self.emit("%s %s;" % (ctype, field.name), depth)
630
631 def isNumeric(self, field):
632 return get_c_type(field.type) in ("int", "bool")

Callers 2

complexSumMethod · 0.95
visitProductMethod · 0.95

Calls 3

isSimpleTypeMethod · 0.95
get_c_typeFunction · 0.85
emitMethod · 0.45

Tested by

no test coverage detected