mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
Issue #4555: All exported C symbols are now prefixed with either "Py" or "_Py".
("make smelly" now clean)
This commit is contained in:
parent
409b53840b
commit
d01d396e7f
6 changed files with 89 additions and 86 deletions
|
@ -25,8 +25,8 @@ typedef struct {
|
||||||
int elements[1];
|
int elements[1];
|
||||||
} asdl_int_seq;
|
} asdl_int_seq;
|
||||||
|
|
||||||
asdl_seq *asdl_seq_new(Py_ssize_t size, PyArena *arena);
|
asdl_seq *_Py_asdl_seq_new(Py_ssize_t size, PyArena *arena);
|
||||||
asdl_int_seq *asdl_int_seq_new(Py_ssize_t size, PyArena *arena);
|
asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena);
|
||||||
|
|
||||||
#define asdl_seq_GET(S, I) (S)->elements[(I)]
|
#define asdl_seq_GET(S, I) (S)->elements[(I)]
|
||||||
#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)
|
#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)
|
||||||
|
|
|
@ -10,6 +10,9 @@ Projected release date: 2013-10-20
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #4555: All exported C symbols are now prefixed with either
|
||||||
|
"Py" or "_Py".
|
||||||
|
|
||||||
- Issue #19219: Speed up marshal.loads(), and make pyc files slightly
|
- Issue #19219: Speed up marshal.loads(), and make pyc files slightly
|
||||||
(5% to 10%) smaller.
|
(5% to 10%) smaller.
|
||||||
|
|
||||||
|
|
|
@ -519,9 +519,9 @@ class Obj2ModVisitor(PickleVisitor):
|
||||||
self.emit("}", depth+1)
|
self.emit("}", depth+1)
|
||||||
self.emit("len = PyList_GET_SIZE(tmp);", depth+1)
|
self.emit("len = PyList_GET_SIZE(tmp);", depth+1)
|
||||||
if self.isSimpleType(field):
|
if self.isSimpleType(field):
|
||||||
self.emit("%s = asdl_int_seq_new(len, arena);" % field.name, depth+1)
|
self.emit("%s = _Py_asdl_int_seq_new(len, arena);" % field.name, depth+1)
|
||||||
else:
|
else:
|
||||||
self.emit("%s = asdl_seq_new(len, arena);" % field.name, depth+1)
|
self.emit("%s = _Py_asdl_seq_new(len, arena);" % field.name, depth+1)
|
||||||
self.emit("if (%s == NULL) goto failed;" % field.name, depth+1)
|
self.emit("if (%s == NULL) goto failed;" % field.name, depth+1)
|
||||||
self.emit("for (i = 0; i < len; i++) {", depth+1)
|
self.emit("for (i = 0; i < len; i++) {", depth+1)
|
||||||
self.emit("%s value;" % ctype, depth+2)
|
self.emit("%s value;" % ctype, depth+2)
|
||||||
|
|
|
@ -3612,7 +3612,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -3647,7 +3647,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -3704,7 +3704,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -3807,7 +3807,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -3831,7 +3831,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
decorator_list = asdl_seq_new(len, arena);
|
decorator_list = _Py_asdl_seq_new(len, arena);
|
||||||
if (decorator_list == NULL) goto failed;
|
if (decorator_list == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -3894,7 +3894,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
bases = asdl_seq_new(len, arena);
|
bases = _Py_asdl_seq_new(len, arena);
|
||||||
if (bases == NULL) goto failed;
|
if (bases == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -3918,7 +3918,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
keywords = asdl_seq_new(len, arena);
|
keywords = _Py_asdl_seq_new(len, arena);
|
||||||
if (keywords == NULL) goto failed;
|
if (keywords == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
keyword_ty value;
|
keyword_ty value;
|
||||||
|
@ -3962,7 +3962,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -3986,7 +3986,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
decorator_list = asdl_seq_new(len, arena);
|
decorator_list = _Py_asdl_seq_new(len, arena);
|
||||||
if (decorator_list == NULL) goto failed;
|
if (decorator_list == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -4043,7 +4043,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
targets = asdl_seq_new(len, arena);
|
targets = _Py_asdl_seq_new(len, arena);
|
||||||
if (targets == NULL) goto failed;
|
if (targets == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -4079,7 +4079,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
targets = asdl_seq_new(len, arena);
|
targets = _Py_asdl_seq_new(len, arena);
|
||||||
if (targets == NULL) goto failed;
|
if (targets == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -4196,7 +4196,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4220,7 +4220,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
orelse = asdl_seq_new(len, arena);
|
orelse = _Py_asdl_seq_new(len, arena);
|
||||||
if (orelse == NULL) goto failed;
|
if (orelse == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4268,7 +4268,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4292,7 +4292,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
orelse = asdl_seq_new(len, arena);
|
orelse = _Py_asdl_seq_new(len, arena);
|
||||||
if (orelse == NULL) goto failed;
|
if (orelse == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4340,7 +4340,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4364,7 +4364,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
orelse = asdl_seq_new(len, arena);
|
orelse = _Py_asdl_seq_new(len, arena);
|
||||||
if (orelse == NULL) goto failed;
|
if (orelse == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4400,7 +4400,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
items = asdl_seq_new(len, arena);
|
items = _Py_asdl_seq_new(len, arena);
|
||||||
if (items == NULL) goto failed;
|
if (items == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
withitem_ty value;
|
withitem_ty value;
|
||||||
|
@ -4424,7 +4424,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4494,7 +4494,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4518,7 +4518,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
handlers = asdl_seq_new(len, arena);
|
handlers = _Py_asdl_seq_new(len, arena);
|
||||||
if (handlers == NULL) goto failed;
|
if (handlers == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
excepthandler_ty value;
|
excepthandler_ty value;
|
||||||
|
@ -4542,7 +4542,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
orelse = asdl_seq_new(len, arena);
|
orelse = _Py_asdl_seq_new(len, arena);
|
||||||
if (orelse == NULL) goto failed;
|
if (orelse == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4566,7 +4566,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
finalbody = asdl_seq_new(len, arena);
|
finalbody = _Py_asdl_seq_new(len, arena);
|
||||||
if (finalbody == NULL) goto failed;
|
if (finalbody == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -4635,7 +4635,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
names = asdl_seq_new(len, arena);
|
names = _Py_asdl_seq_new(len, arena);
|
||||||
if (names == NULL) goto failed;
|
if (names == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
alias_ty value;
|
alias_ty value;
|
||||||
|
@ -4682,7 +4682,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
names = asdl_seq_new(len, arena);
|
names = _Py_asdl_seq_new(len, arena);
|
||||||
if (names == NULL) goto failed;
|
if (names == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
alias_ty value;
|
alias_ty value;
|
||||||
|
@ -4727,7 +4727,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
names = asdl_seq_new(len, arena);
|
names = _Py_asdl_seq_new(len, arena);
|
||||||
if (names == NULL) goto failed;
|
if (names == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
identifier value;
|
identifier value;
|
||||||
|
@ -4762,7 +4762,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
names = asdl_seq_new(len, arena);
|
names = _Py_asdl_seq_new(len, arena);
|
||||||
if (names == NULL) goto failed;
|
if (names == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
identifier value;
|
identifier value;
|
||||||
|
@ -4903,7 +4903,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
values = asdl_seq_new(len, arena);
|
values = _Py_asdl_seq_new(len, arena);
|
||||||
if (values == NULL) goto failed;
|
if (values == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -5099,7 +5099,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
keys = asdl_seq_new(len, arena);
|
keys = _Py_asdl_seq_new(len, arena);
|
||||||
if (keys == NULL) goto failed;
|
if (keys == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -5123,7 +5123,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
values = asdl_seq_new(len, arena);
|
values = _Py_asdl_seq_new(len, arena);
|
||||||
if (values == NULL) goto failed;
|
if (values == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -5158,7 +5158,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
elts = asdl_seq_new(len, arena);
|
elts = _Py_asdl_seq_new(len, arena);
|
||||||
if (elts == NULL) goto failed;
|
if (elts == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -5205,7 +5205,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
generators = asdl_seq_new(len, arena);
|
generators = _Py_asdl_seq_new(len, arena);
|
||||||
if (generators == NULL) goto failed;
|
if (generators == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
comprehension_ty value;
|
comprehension_ty value;
|
||||||
|
@ -5252,7 +5252,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
generators = asdl_seq_new(len, arena);
|
generators = _Py_asdl_seq_new(len, arena);
|
||||||
if (generators == NULL) goto failed;
|
if (generators == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
comprehension_ty value;
|
comprehension_ty value;
|
||||||
|
@ -5311,7 +5311,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
generators = asdl_seq_new(len, arena);
|
generators = _Py_asdl_seq_new(len, arena);
|
||||||
if (generators == NULL) goto failed;
|
if (generators == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
comprehension_ty value;
|
comprehension_ty value;
|
||||||
|
@ -5358,7 +5358,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
generators = asdl_seq_new(len, arena);
|
generators = _Py_asdl_seq_new(len, arena);
|
||||||
if (generators == NULL) goto failed;
|
if (generators == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
comprehension_ty value;
|
comprehension_ty value;
|
||||||
|
@ -5449,7 +5449,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
ops = asdl_int_seq_new(len, arena);
|
ops = _Py_asdl_int_seq_new(len, arena);
|
||||||
if (ops == NULL) goto failed;
|
if (ops == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
cmpop_ty value;
|
cmpop_ty value;
|
||||||
|
@ -5473,7 +5473,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
comparators = asdl_seq_new(len, arena);
|
comparators = _Py_asdl_seq_new(len, arena);
|
||||||
if (comparators == NULL) goto failed;
|
if (comparators == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -5523,7 +5523,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
args = asdl_seq_new(len, arena);
|
args = _Py_asdl_seq_new(len, arena);
|
||||||
if (args == NULL) goto failed;
|
if (args == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -5547,7 +5547,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
keywords = asdl_seq_new(len, arena);
|
keywords = _Py_asdl_seq_new(len, arena);
|
||||||
if (keywords == NULL) goto failed;
|
if (keywords == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
keyword_ty value;
|
keyword_ty value;
|
||||||
|
@ -5862,7 +5862,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
elts = asdl_seq_new(len, arena);
|
elts = _Py_asdl_seq_new(len, arena);
|
||||||
if (elts == NULL) goto failed;
|
if (elts == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -5909,7 +5909,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
elts = asdl_seq_new(len, arena);
|
elts = _Py_asdl_seq_new(len, arena);
|
||||||
if (elts == NULL) goto failed;
|
if (elts == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -6074,7 +6074,7 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
dims = asdl_seq_new(len, arena);
|
dims = _Py_asdl_seq_new(len, arena);
|
||||||
if (dims == NULL) goto failed;
|
if (dims == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
slice_ty value;
|
slice_ty value;
|
||||||
|
@ -6425,7 +6425,7 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
ifs = asdl_seq_new(len, arena);
|
ifs = _Py_asdl_seq_new(len, arena);
|
||||||
if (ifs == NULL) goto failed;
|
if (ifs == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -6520,7 +6520,7 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
body = asdl_seq_new(len, arena);
|
body = _Py_asdl_seq_new(len, arena);
|
||||||
if (body == NULL) goto failed;
|
if (body == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
stmt_ty value;
|
stmt_ty value;
|
||||||
|
@ -6566,7 +6566,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
args = asdl_seq_new(len, arena);
|
args = _Py_asdl_seq_new(len, arena);
|
||||||
if (args == NULL) goto failed;
|
if (args == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
arg_ty value;
|
arg_ty value;
|
||||||
|
@ -6600,7 +6600,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
kwonlyargs = asdl_seq_new(len, arena);
|
kwonlyargs = _Py_asdl_seq_new(len, arena);
|
||||||
if (kwonlyargs == NULL) goto failed;
|
if (kwonlyargs == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
arg_ty value;
|
arg_ty value;
|
||||||
|
@ -6624,7 +6624,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
kw_defaults = asdl_seq_new(len, arena);
|
kw_defaults = _Py_asdl_seq_new(len, arena);
|
||||||
if (kw_defaults == NULL) goto failed;
|
if (kw_defaults == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
@ -6658,7 +6658,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
len = PyList_GET_SIZE(tmp);
|
len = PyList_GET_SIZE(tmp);
|
||||||
defaults = asdl_seq_new(len, arena);
|
defaults = _Py_asdl_seq_new(len, arena);
|
||||||
if (defaults == NULL) goto failed;
|
if (defaults == NULL) goto failed;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
expr_ty value;
|
expr_ty value;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "asdl.h"
|
#include "asdl.h"
|
||||||
|
|
||||||
asdl_seq *
|
asdl_seq *
|
||||||
asdl_seq_new(Py_ssize_t size, PyArena *arena)
|
_Py_asdl_seq_new(Py_ssize_t size, PyArena *arena)
|
||||||
{
|
{
|
||||||
asdl_seq *seq = NULL;
|
asdl_seq *seq = NULL;
|
||||||
size_t n = (size ? (sizeof(void *) * (size - 1)) : 0);
|
size_t n = (size ? (sizeof(void *) * (size - 1)) : 0);
|
||||||
|
@ -33,7 +33,7 @@ asdl_seq_new(Py_ssize_t size, PyArena *arena)
|
||||||
}
|
}
|
||||||
|
|
||||||
asdl_int_seq *
|
asdl_int_seq *
|
||||||
asdl_int_seq_new(Py_ssize_t size, PyArena *arena)
|
_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena)
|
||||||
{
|
{
|
||||||
asdl_int_seq *seq = NULL;
|
asdl_int_seq *seq = NULL;
|
||||||
size_t n = (size ? (sizeof(void *) * (size - 1)) : 0);
|
size_t n = (size ? (sizeof(void *) * (size - 1)) : 0);
|
||||||
|
|
64
Python/ast.c
64
Python/ast.c
|
@ -696,7 +696,7 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags,
|
||||||
k = 0;
|
k = 0;
|
||||||
switch (TYPE(n)) {
|
switch (TYPE(n)) {
|
||||||
case file_input:
|
case file_input:
|
||||||
stmts = asdl_seq_new(num_stmts(n), arena);
|
stmts = _Py_asdl_seq_new(num_stmts(n), arena);
|
||||||
if (!stmts)
|
if (!stmts)
|
||||||
goto out;
|
goto out;
|
||||||
for (i = 0; i < NCH(n) - 1; i++) {
|
for (i = 0; i < NCH(n) - 1; i++) {
|
||||||
|
@ -736,7 +736,7 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags,
|
||||||
}
|
}
|
||||||
case single_input:
|
case single_input:
|
||||||
if (TYPE(CHILD(n, 0)) == NEWLINE) {
|
if (TYPE(CHILD(n, 0)) == NEWLINE) {
|
||||||
stmts = asdl_seq_new(1, arena);
|
stmts = _Py_asdl_seq_new(1, arena);
|
||||||
if (!stmts)
|
if (!stmts)
|
||||||
goto out;
|
goto out;
|
||||||
asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
|
asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
|
||||||
|
@ -748,7 +748,7 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags,
|
||||||
else {
|
else {
|
||||||
n = CHILD(n, 0);
|
n = CHILD(n, 0);
|
||||||
num = num_stmts(n);
|
num = num_stmts(n);
|
||||||
stmts = asdl_seq_new(num, arena);
|
stmts = _Py_asdl_seq_new(num, arena);
|
||||||
if (!stmts)
|
if (!stmts)
|
||||||
goto out;
|
goto out;
|
||||||
if (num == 1) {
|
if (num == 1) {
|
||||||
|
@ -1099,7 +1099,7 @@ seq_for_testlist(struct compiling *c, const node *n)
|
||||||
int i;
|
int i;
|
||||||
assert(TYPE(n) == testlist || TYPE(n) == testlist_star_expr || TYPE(n) == testlist_comp);
|
assert(TYPE(n) == testlist || TYPE(n) == testlist_star_expr || TYPE(n) == testlist_comp);
|
||||||
|
|
||||||
seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
seq = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
||||||
if (!seq)
|
if (!seq)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1279,22 +1279,22 @@ ast_for_arguments(struct compiling *c, const node *n)
|
||||||
if (TYPE(ch) == DOUBLESTAR) break;
|
if (TYPE(ch) == DOUBLESTAR) break;
|
||||||
if (TYPE(ch) == tfpdef || TYPE(ch) == vfpdef) nkwonlyargs++;
|
if (TYPE(ch) == tfpdef || TYPE(ch) == vfpdef) nkwonlyargs++;
|
||||||
}
|
}
|
||||||
posargs = (nposargs ? asdl_seq_new(nposargs, c->c_arena) : NULL);
|
posargs = (nposargs ? _Py_asdl_seq_new(nposargs, c->c_arena) : NULL);
|
||||||
if (!posargs && nposargs)
|
if (!posargs && nposargs)
|
||||||
return NULL;
|
return NULL;
|
||||||
kwonlyargs = (nkwonlyargs ?
|
kwonlyargs = (nkwonlyargs ?
|
||||||
asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
|
_Py_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
|
||||||
if (!kwonlyargs && nkwonlyargs)
|
if (!kwonlyargs && nkwonlyargs)
|
||||||
return NULL;
|
return NULL;
|
||||||
posdefaults = (nposdefaults ?
|
posdefaults = (nposdefaults ?
|
||||||
asdl_seq_new(nposdefaults, c->c_arena) : NULL);
|
_Py_asdl_seq_new(nposdefaults, c->c_arena) : NULL);
|
||||||
if (!posdefaults && nposdefaults)
|
if (!posdefaults && nposdefaults)
|
||||||
return NULL;
|
return NULL;
|
||||||
/* The length of kwonlyargs and kwdefaults are same
|
/* The length of kwonlyargs and kwdefaults are same
|
||||||
since we set NULL as default for keyword only argument w/o default
|
since we set NULL as default for keyword only argument w/o default
|
||||||
- we have sequence data structure, but no dictionary */
|
- we have sequence data structure, but no dictionary */
|
||||||
kwdefaults = (nkwonlyargs ?
|
kwdefaults = (nkwonlyargs ?
|
||||||
asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
|
_Py_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
|
||||||
if (!kwdefaults && nkwonlyargs)
|
if (!kwdefaults && nkwonlyargs)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1462,7 +1462,7 @@ ast_for_decorators(struct compiling *c, const node *n)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
REQ(n, decorators);
|
REQ(n, decorators);
|
||||||
decorator_seq = asdl_seq_new(NCH(n), c->c_arena);
|
decorator_seq = _Py_asdl_seq_new(NCH(n), c->c_arena);
|
||||||
if (!decorator_seq)
|
if (!decorator_seq)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1658,7 +1658,7 @@ ast_for_comprehension(struct compiling *c, const node *n)
|
||||||
if (n_fors == -1)
|
if (n_fors == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
comps = asdl_seq_new(n_fors, c->c_arena);
|
comps = _Py_asdl_seq_new(n_fors, c->c_arena);
|
||||||
if (!comps)
|
if (!comps)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1699,7 +1699,7 @@ ast_for_comprehension(struct compiling *c, const node *n)
|
||||||
if (n_ifs == -1)
|
if (n_ifs == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ifs = asdl_seq_new(n_ifs, c->c_arena);
|
ifs = _Py_asdl_seq_new(n_ifs, c->c_arena);
|
||||||
if (!ifs)
|
if (!ifs)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1921,7 +1921,7 @@ ast_for_atom(struct compiling *c, const node *n)
|
||||||
/* it's a simple set */
|
/* it's a simple set */
|
||||||
asdl_seq *elts;
|
asdl_seq *elts;
|
||||||
size = (NCH(ch) + 1) / 2; /* +1 in case no trailing comma */
|
size = (NCH(ch) + 1) / 2; /* +1 in case no trailing comma */
|
||||||
elts = asdl_seq_new(size, c->c_arena);
|
elts = _Py_asdl_seq_new(size, c->c_arena);
|
||||||
if (!elts)
|
if (!elts)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = 0; i < NCH(ch); i += 2) {
|
for (i = 0; i < NCH(ch); i += 2) {
|
||||||
|
@ -1940,11 +1940,11 @@ ast_for_atom(struct compiling *c, const node *n)
|
||||||
} else {
|
} else {
|
||||||
/* it's a dict */
|
/* it's a dict */
|
||||||
size = (NCH(ch) + 1) / 4; /* +1 in case no trailing comma */
|
size = (NCH(ch) + 1) / 4; /* +1 in case no trailing comma */
|
||||||
keys = asdl_seq_new(size, c->c_arena);
|
keys = _Py_asdl_seq_new(size, c->c_arena);
|
||||||
if (!keys)
|
if (!keys)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
values = asdl_seq_new(size, c->c_arena);
|
values = _Py_asdl_seq_new(size, c->c_arena);
|
||||||
if (!values)
|
if (!values)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -2139,7 +2139,7 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr)
|
||||||
expr_ty e;
|
expr_ty e;
|
||||||
int simple = 1;
|
int simple = 1;
|
||||||
asdl_seq *slices, *elts;
|
asdl_seq *slices, *elts;
|
||||||
slices = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
slices = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
||||||
if (!slices)
|
if (!slices)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (j = 0; j < NCH(n); j += 2) {
|
for (j = 0; j < NCH(n); j += 2) {
|
||||||
|
@ -2155,7 +2155,7 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr)
|
||||||
Load, LINENO(n), n->n_col_offset, c->c_arena);
|
Load, LINENO(n), n->n_col_offset, c->c_arena);
|
||||||
}
|
}
|
||||||
/* extract Index values and put them in a Tuple */
|
/* extract Index values and put them in a Tuple */
|
||||||
elts = asdl_seq_new(asdl_seq_LEN(slices), c->c_arena);
|
elts = _Py_asdl_seq_new(asdl_seq_LEN(slices), c->c_arena);
|
||||||
if (!elts)
|
if (!elts)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (j = 0; j < asdl_seq_LEN(slices); ++j) {
|
for (j = 0; j < asdl_seq_LEN(slices); ++j) {
|
||||||
|
@ -2288,7 +2288,7 @@ ast_for_expr(struct compiling *c, const node *n)
|
||||||
n = CHILD(n, 0);
|
n = CHILD(n, 0);
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
seq = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
||||||
if (!seq)
|
if (!seq)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = 0; i < NCH(n); i += 2) {
|
for (i = 0; i < NCH(n); i += 2) {
|
||||||
|
@ -2324,10 +2324,10 @@ ast_for_expr(struct compiling *c, const node *n)
|
||||||
expr_ty expression;
|
expr_ty expression;
|
||||||
asdl_int_seq *ops;
|
asdl_int_seq *ops;
|
||||||
asdl_seq *cmps;
|
asdl_seq *cmps;
|
||||||
ops = asdl_int_seq_new(NCH(n) / 2, c->c_arena);
|
ops = _Py_asdl_int_seq_new(NCH(n) / 2, c->c_arena);
|
||||||
if (!ops)
|
if (!ops)
|
||||||
return NULL;
|
return NULL;
|
||||||
cmps = asdl_seq_new(NCH(n) / 2, c->c_arena);
|
cmps = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena);
|
||||||
if (!cmps) {
|
if (!cmps) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -2453,10 +2453,10 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
args = asdl_seq_new(nargs + ngens, c->c_arena);
|
args = _Py_asdl_seq_new(nargs + ngens, c->c_arena);
|
||||||
if (!args)
|
if (!args)
|
||||||
return NULL;
|
return NULL;
|
||||||
keywords = asdl_seq_new(nkeywords, c->c_arena);
|
keywords = _Py_asdl_seq_new(nkeywords, c->c_arena);
|
||||||
if (!keywords)
|
if (!keywords)
|
||||||
return NULL;
|
return NULL;
|
||||||
nargs = 0;
|
nargs = 0;
|
||||||
|
@ -2633,7 +2633,7 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
|
||||||
|
|
||||||
/* a normal assignment */
|
/* a normal assignment */
|
||||||
REQ(CHILD(n, 1), EQUAL);
|
REQ(CHILD(n, 1), EQUAL);
|
||||||
targets = asdl_seq_new(NCH(n) / 2, c->c_arena);
|
targets = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena);
|
||||||
if (!targets)
|
if (!targets)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = 0; i < NCH(n) - 2; i += 2) {
|
for (i = 0; i < NCH(n) - 2; i += 2) {
|
||||||
|
@ -2674,7 +2674,7 @@ ast_for_exprlist(struct compiling *c, const node *n, expr_context_ty context)
|
||||||
|
|
||||||
REQ(n, exprlist);
|
REQ(n, exprlist);
|
||||||
|
|
||||||
seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
seq = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
||||||
if (!seq)
|
if (!seq)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = 0; i < NCH(n); i += 2) {
|
for (i = 0; i < NCH(n); i += 2) {
|
||||||
|
@ -2904,7 +2904,7 @@ ast_for_import_stmt(struct compiling *c, const node *n)
|
||||||
if (TYPE(n) == import_name) {
|
if (TYPE(n) == import_name) {
|
||||||
n = CHILD(n, 1);
|
n = CHILD(n, 1);
|
||||||
REQ(n, dotted_as_names);
|
REQ(n, dotted_as_names);
|
||||||
aliases = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
aliases = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
|
||||||
if (!aliases)
|
if (!aliases)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = 0; i < NCH(n); i += 2) {
|
for (i = 0; i < NCH(n); i += 2) {
|
||||||
|
@ -2966,7 +2966,7 @@ ast_for_import_stmt(struct compiling *c, const node *n)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
aliases = asdl_seq_new((n_children + 1) / 2, c->c_arena);
|
aliases = _Py_asdl_seq_new((n_children + 1) / 2, c->c_arena);
|
||||||
if (!aliases)
|
if (!aliases)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -3005,7 +3005,7 @@ ast_for_global_stmt(struct compiling *c, const node *n)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
REQ(n, global_stmt);
|
REQ(n, global_stmt);
|
||||||
s = asdl_seq_new(NCH(n) / 2, c->c_arena);
|
s = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena);
|
||||||
if (!s)
|
if (!s)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = 1; i < NCH(n); i += 2) {
|
for (i = 1; i < NCH(n); i += 2) {
|
||||||
|
@ -3026,7 +3026,7 @@ ast_for_nonlocal_stmt(struct compiling *c, const node *n)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
REQ(n, nonlocal_stmt);
|
REQ(n, nonlocal_stmt);
|
||||||
s = asdl_seq_new(NCH(n) / 2, c->c_arena);
|
s = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena);
|
||||||
if (!s)
|
if (!s)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = 1; i < NCH(n); i += 2) {
|
for (i = 1; i < NCH(n); i += 2) {
|
||||||
|
@ -3079,7 +3079,7 @@ ast_for_suite(struct compiling *c, const node *n)
|
||||||
REQ(n, suite);
|
REQ(n, suite);
|
||||||
|
|
||||||
total = num_stmts(n);
|
total = num_stmts(n);
|
||||||
seq = asdl_seq_new(total, c->c_arena);
|
seq = _Py_asdl_seq_new(total, c->c_arena);
|
||||||
if (!seq)
|
if (!seq)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (TYPE(CHILD(n, 0)) == simple_stmt) {
|
if (TYPE(CHILD(n, 0)) == simple_stmt) {
|
||||||
|
@ -3198,7 +3198,7 @@ ast_for_if_stmt(struct compiling *c, const node *n)
|
||||||
if (has_else) {
|
if (has_else) {
|
||||||
asdl_seq *suite_seq2;
|
asdl_seq *suite_seq2;
|
||||||
|
|
||||||
orelse = asdl_seq_new(1, c->c_arena);
|
orelse = _Py_asdl_seq_new(1, c->c_arena);
|
||||||
if (!orelse)
|
if (!orelse)
|
||||||
return NULL;
|
return NULL;
|
||||||
expression = ast_for_expr(c, CHILD(n, NCH(n) - 6));
|
expression = ast_for_expr(c, CHILD(n, NCH(n) - 6));
|
||||||
|
@ -3222,7 +3222,7 @@ ast_for_if_stmt(struct compiling *c, const node *n)
|
||||||
|
|
||||||
for (i = 0; i < n_elif; i++) {
|
for (i = 0; i < n_elif; i++) {
|
||||||
int off = 5 + (n_elif - i - 1) * 4;
|
int off = 5 + (n_elif - i - 1) * 4;
|
||||||
asdl_seq *newobj = asdl_seq_new(1, c->c_arena);
|
asdl_seq *newobj = _Py_asdl_seq_new(1, c->c_arena);
|
||||||
if (!newobj)
|
if (!newobj)
|
||||||
return NULL;
|
return NULL;
|
||||||
expression = ast_for_expr(c, CHILD(n, off));
|
expression = ast_for_expr(c, CHILD(n, off));
|
||||||
|
@ -3434,7 +3434,7 @@ ast_for_try_stmt(struct compiling *c, const node *n)
|
||||||
if (n_except > 0) {
|
if (n_except > 0) {
|
||||||
int i;
|
int i;
|
||||||
/* process except statements to create a try ... except */
|
/* process except statements to create a try ... except */
|
||||||
handlers = asdl_seq_new(n_except, c->c_arena);
|
handlers = _Py_asdl_seq_new(n_except, c->c_arena);
|
||||||
if (handlers == NULL)
|
if (handlers == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -3485,7 +3485,7 @@ ast_for_with_stmt(struct compiling *c, const node *n)
|
||||||
REQ(n, with_stmt);
|
REQ(n, with_stmt);
|
||||||
|
|
||||||
n_items = (NCH(n) - 2) / 2;
|
n_items = (NCH(n) - 2) / 2;
|
||||||
items = asdl_seq_new(n_items, c->c_arena);
|
items = _Py_asdl_seq_new(n_items, c->c_arena);
|
||||||
if (!items)
|
if (!items)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = 1; i < NCH(n) - 2; i += 2) {
|
for (i = 1; i < NCH(n) - 2; i += 2) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue