mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Added filename to compiling struct based on Martin's suggestion.
I'm wonder why I was trying to add the filename to the node all the time. The compiling struct is more obvious.
This commit is contained in:
parent
9401cbe0e9
commit
ffcd1e10b6
1 changed files with 3 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
||||||
struct compiling {
|
struct compiling {
|
||||||
char *c_encoding; /* source encoding */
|
char *c_encoding; /* source encoding */
|
||||||
PyArena *c_arena; /* arena for allocating memeory */
|
PyArena *c_arena; /* arena for allocating memeory */
|
||||||
|
const char *c_filename; /* filename */
|
||||||
};
|
};
|
||||||
|
|
||||||
static asdl_seq *seq_for_testlist(struct compiling *, const node *);
|
static asdl_seq *seq_for_testlist(struct compiling *, const node *);
|
||||||
|
@ -197,6 +198,7 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
|
||||||
c.c_encoding = NULL;
|
c.c_encoding = NULL;
|
||||||
}
|
}
|
||||||
c.c_arena = arena;
|
c.c_arena = arena;
|
||||||
|
c.c_filename = filename;
|
||||||
|
|
||||||
k = 0;
|
k = 0;
|
||||||
switch (TYPE(n)) {
|
switch (TYPE(n)) {
|
||||||
|
@ -1340,7 +1342,7 @@ ast_for_atom(struct compiling *c, const node *n)
|
||||||
if (Py_Py3kWarningFlag) {
|
if (Py_Py3kWarningFlag) {
|
||||||
if (PyErr_WarnExplicit(PyExc_DeprecationWarning,
|
if (PyErr_WarnExplicit(PyExc_DeprecationWarning,
|
||||||
"backquote not supported in 3.x",
|
"backquote not supported in 3.x",
|
||||||
"<unknown>", LINENO(n),
|
c->c_filename, LINENO(n),
|
||||||
NULL, NULL)) {
|
NULL, NULL)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue