{{ message }}
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the code is not working without this explicit whitespace-skipping, that is a pyparsing bug. Since you have made it Optional, then this won't break once the pyparsing bug is fixed. (You can also - or at least should be able to - use
Empty()as a synonym forSuppress(Optional(White()))There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. There is a bug in pyparsing, but fixing it doesn't completely solve your problem.
What is the purpose of
leaveWhitespace()here?It looks like this is the only element in
p.placeablethat suppresses whitespace-skipping. The new code detects this and instead of doing whitespace-skipping before theMatchFirst, it doesn't do whitespace-skipping, relying on all the separate elements to do it themselves (this is the performance optimization - if all the alternatives will want whitespace to be skipped, theMatchFirstwill do it once, and then all the alternatives get a pass). Sincep.symbolsuppresses whitespace-skipping, and so makesp.placeablesuppress whitespace-skipping, then when it is time to matchp.symbol, the leading space has not been skipped, and so it fails.So:
I need to fix the bug in pyparsing - this will be in 3.0.4, which I will push out this evening.
This is another pyparsing improvement that needs to be documented in the "stuff that has changed for the better, but may affect your code" - I'll add that information in 3.0.4 also.
Please revisit why you need to have
leaveWhitespace()onp.symbol.If it is required, then I think you could remove the
Suppress(Optional(White()))fromp.accent, and instead change thep.symbolusage inp.placeableto:(I tested this in my minimal repro example and that works.)
But ideally, you could just remove the call to
leaveWhitespace().There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that removing leaveWhitespace seems to work; looking at the git history it seems to be a historical artefact of the times when symbol and symbol_name were not split, and was used for symbol_name.