mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +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
|
@ -98,8 +98,11 @@ module Python version "$Revision$"
|
|||
comprehension = (expr target, expr iter, expr* ifs)
|
||||
|
||||
-- not sure what to call the first argument for raise and except
|
||||
|
||||
excepthandler = (expr? type, expr? name, stmt* body)
|
||||
-- TODO(jhylton): Figure out if there is a better way to handle
|
||||
-- lineno and col_offset fields, particularly when
|
||||
-- ast is exposed to Python.
|
||||
excepthandler = (expr? type, expr? name, stmt* body, int lineno,
|
||||
int col_offset)
|
||||
|
||||
arguments = (expr* args, identifier? vararg,
|
||||
identifier? kwarg, expr* defaults)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue