bpo-40334: Improve column offsets for thrown syntax errors by Pegen by isidentical · Pull Request #19782 · python/cpython
Conversation
I've been trying to figure out a good way to handle ast.c errors, but no luck so far. I've splitted them to their own test and fixed remaining offset errors to ensure full compatibility with the old parser.
isidentical
changed the title
bpo-40344: Improve column offsets for thrown syntax errors by Pegen
bpo-40334: Improve column offsets for thrown syntax errors by Pegen
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @isidentical for spending time on this! It's a really nice improvement.
@isidentical there's a merge conflict -- you need to merge master and run make regen-pegen. Then I'm good with merging this.
Hummm, there is a bunch of warnings now after the last rebasing:
/home/travis/build/python/cpython/Parser/pegen/pegen.h:194:59: warning: incompatible pointer to integer conversion passing 'char [45]' to parameter of type 'int' [-Wint-conversion]
return _PyPegen_raise_error(p, PyExc_SyntaxError, "%s only supported in Python 3.%i and greater",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@isidentical could you take a look? Seems that we are passing the error message incorrectly with this PR
Seems that we are passing the error message incorrectly with this PR
Yup, this PR changes signature of _PyPegen_raise_error. I missed that usage when I rebased. Now, it should be fixed.
This was referenced