summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMichael J. Sullivan <sully@msully.net>2019-05-22 14:54:20 (GMT)
committerIvan Levkivskyi <levkivskyi@gmail.com>2019-05-22 14:54:20 (GMT)
commit933e1509ec6efa8e6ab8c8c7ce02059ce2b6d9b9 (patch)
tree97980dec3873370773b481e2bc1f08f9f1624b9d /Include
parent4c7a46eb3c009c85ddf2eb315d94d804745187d4 (diff)
downloadcpython-933e1509ec6efa8e6ab8c8c7ce02059ce2b6d9b9.zip
cpython-933e1509ec6efa8e6ab8c8c7ce02059ce2b6d9b9.tar.gz
cpython-933e1509ec6efa8e6ab8c8c7ce02059ce2b6d9b9.tar.bz2
bpo-36878: Track extra text added to 'type: ignore' in the AST (GH-13479)
GH-13238 made extra text after a # type: ignore accepted by the parser. This finishes the job and actually plumbs the extra text through the parser and makes it available in the AST.
Diffstat (limited to 'Include')
-rw-r--r--Include/Python-ast.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h
index 08d50ff..2fc50e3 100644
--- a/Include/Python-ast.h
+++ b/Include/Python-ast.h
@@ -467,6 +467,7 @@ struct _type_ignore {
union {
struct {
int lineno;
+ string tag;
} TypeIgnore;
} v;
@@ -702,8 +703,8 @@ alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena);
#define withitem(a0, a1, a2) _Py_withitem(a0, a1, a2)
withitem_ty _Py_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena
*arena);
-#define TypeIgnore(a0, a1) _Py_TypeIgnore(a0, a1)
-type_ignore_ty _Py_TypeIgnore(int lineno, PyArena *arena);
+#define TypeIgnore(a0, a1, a2) _Py_TypeIgnore(a0, a1, a2)
+type_ignore_ty _Py_TypeIgnore(int lineno, string tag, PyArena *arena);
PyObject* PyAST_mod2obj(mod_ty t);
mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);