-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix line numbers generated by the compiler #469
Comments
Question for @markshannon re python/cpython@c544093 . Where in PEP 626 is it prescribed that the POP_TOP after an expression statement is artificial? Could it not be assigned the location of the expression? (I don't see any discussion of this in python/cpython#86412). |
The end result (after propagating line numbers etc) is actually the same as what we would get if we do what I suggest above. So maybe it's ok to just assign that lineno at codegen time?
Output:
|
Ah, I see now (from the test in the commit I linked above) why this was done. The expression extends beyond the function call. |
I've done as much as I intend to do on this - the line-number mechanism is more under control now, the individual cases I didn't cover will be done separately as we find issues. |
The line number calculation is a little off in a few places, and involves some guesswork and estimation. This issue is to make it more accurate, so that we can safely move this code to before the optimization stage (see python/cpython#87092).
Particular issues:
python/cpython#98390
python/cpython#98398
python/cpython#98442
python/cpython#98461
python/cpython#98762
The text was updated successfully, but these errors were encountered: