diff options
author | Georg Brandl <georg@python.org> | 2008-03-30 06:40:17 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-30 06:40:17 (GMT) |
commit | a48f3ab8951fa97844f2a4fa368483af968b7b73 (patch) | |
tree | 59349d2cbbcb23204391adcd8c1a37896d2ab16e /Include | |
parent | c15317efcd21015a2e076eb0413043c74d84056f (diff) | |
download | cpython-a48f3ab8951fa97844f2a4fa368483af968b7b73.zip cpython-a48f3ab8951fa97844f2a4fa368483af968b7b73.tar.gz cpython-a48f3ab8951fa97844f2a4fa368483af968b7b73.tar.bz2 |
Patch #2511: Give the "excepthandler" AST item proper attributes by making it a Sum.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python-ast.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h index f105267..3210fc7 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -324,10 +324,17 @@ struct _comprehension { asdl_seq *ifs; }; +enum _excepthandler_kind {ExceptHandler_kind=1}; struct _excepthandler { - expr_ty type; - expr_ty name; - asdl_seq *body; + enum _excepthandler_kind kind; + union { + struct { + expr_ty type; + expr_ty name; + asdl_seq *body; + } ExceptHandler; + + } v; int lineno; int col_offset; }; @@ -489,8 +496,8 @@ slice_ty _Py_Index(expr_ty value, PyArena *arena); #define comprehension(a0, a1, a2, a3) _Py_comprehension(a0, a1, a2, a3) comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs, PyArena *arena); -#define excepthandler(a0, a1, a2, a3, a4, a5) _Py_excepthandler(a0, a1, a2, a3, a4, a5) -excepthandler_ty _Py_excepthandler(expr_ty type, expr_ty name, asdl_seq * body, +#define ExceptHandler(a0, a1, a2, a3, a4, a5) _Py_ExceptHandler(a0, a1, a2, a3, a4, a5) +excepthandler_ty _Py_ExceptHandler(expr_ty type, expr_ty name, asdl_seq * body, int lineno, int col_offset, PyArena *arena); #define arguments(a0, a1, a2, a3, a4) _Py_arguments(a0, a1, a2, a3, a4) arguments_ty _Py_arguments(asdl_seq * args, identifier vararg, identifier |