diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2006-04-04 04:00:23 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2006-04-04 04:00:23 (GMT) |
commit | 2f327c14eb998e8796a3775aa6a7aade14e97004 (patch) | |
tree | 3de98142ca2b873c0cfb25f630c7dda2d90f96fa /Include | |
parent | cb30f97bd3bdea2e884e8faec23751b39db4c0b3 (diff) | |
download | cpython-2f327c14eb998e8796a3775aa6a7aade14e97004.zip cpython-2f327c14eb998e8796a3775aa6a7aade14e97004.tar.gz cpython-2f327c14eb998e8796a3775aa6a7aade14e97004.tar.bz2 |
Add lineno, col_offset to excephandler to enable future fix for
tracing/line number table in except blocks.
Reflow long lines introduced by col_offset changes. Update test_ast
to handle new fields in excepthandler.
As note in Python.asdl says, we might want to rethink how attributes
are handled. Perhaps they should be the same as other fields, with
the primary difference being how they are defined for all types within
a sum.
Also fix asdl_c so that constructors with int fields don't fail when
passed a zero value.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python-ast.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h index b3bc063..7253f97 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -323,6 +323,8 @@ struct _excepthandler { expr_ty type; expr_ty name; asdl_seq *body; + int lineno; + int col_offset; }; struct _arguments { @@ -427,8 +429,8 @@ slice_ty ExtSlice(asdl_seq * dims, PyArena *arena); slice_ty Index(expr_ty value, PyArena *arena); comprehension_ty comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs, PyArena *arena); -excepthandler_ty excepthandler(expr_ty type, expr_ty name, asdl_seq * body, - PyArena *arena); +excepthandler_ty excepthandler(expr_ty type, expr_ty name, asdl_seq * body, int + lineno, int col_offset, PyArena *arena); arguments_ty arguments(asdl_seq * args, identifier vararg, identifier kwarg, asdl_seq * defaults, PyArena *arena); keyword_ty keyword(identifier arg, expr_ty value, PyArena *arena); |