Reporting the state of the parser in these new elogs is OK for me, but we had more cases that what your patch has been updating. I have included all these cases, making the set of error messages a bit more consistent across the board, and applied the result. -- Michael
Rebased. Used new palloc0_array() in a few places, and fixed an expected output message that wasn't updated to reflect the changes.
Disregard v21 (uncommitted changes). Everything I said about 21 applies to 22.