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

Method visitField

Parser/asdl_c.py:2120–2131  ·  view source on GitHub ↗
(self, field, name, depth, product)

Source from the content-addressed store, hash-verified

2118 self.emit("break;", 2)
2119
2120 def visitField(self, field, name, depth, product):
2121 def emit(s, d):
2122 self.emit(s, depth + d)
2123 if product:
2124 value = "o->%s" % field.name
2125 else:
2126 value = "o->v.%s.%s" % (name, field.name)
2127 self.set(field, value, depth)
2128 emit("if (!value) goto failed;", 0)
2129 emit("if (PyObject_SetAttr(result, state->%s, value) == -1)" % field.name, 0)
2130 emit("goto failed;", 1)
2131 emit("Py_DECREF(value);", 0)
2132
2133 def set(self, field, value, depth):
2134 if field.seq:

Callers 2

visitProductMethod · 0.95
visitConstructorMethod · 0.95

Calls 1

setMethod · 0.95

Tested by

no test coverage detected