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

Method visitSum

Parser/asdl_c.py:753–764  ·  view source on GitHub ↗
(self, sum, name)

Source from the content-addressed store, hash-verified

751 self.emit("};", 0)
752
753 def visitSum(self, sum, name):
754 if sum.attributes:
755 self.emit("static const char * const %s_attributes[] = {" % name, 0)
756 for a in sum.attributes:
757 self.emit('"%s",' % a.name, 1)
758 self.emit("};", 0)
759 ptype = "void*"
760 if is_simple(sum):
761 ptype = get_c_type(name)
762 self.emit("static PyObject* ast2obj_%s(struct ast_state *state, %s);" % (name, ptype), 0)
763 for t in sum.types:
764 self.visitConstructor(t, name)
765
766 def visitConstructor(self, cons, name):
767 if cons.fields:

Callers

nothing calls this directly

Calls 4

visitConstructorMethod · 0.95
is_simpleFunction · 0.85
get_c_typeFunction · 0.85
emitMethod · 0.45

Tested by

no test coverage detected