mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
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.
This commit is contained in:
parent
cb30f97bd3
commit
2f327c14eb
6 changed files with 84 additions and 41 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue