Refactor search query parser and handle nested quote types
Addresses https://github.com/mastodon/mastodon/pull/26701#pullrequestreview-1606429189 and https://github.com/mastodon/mastodon/pull/26687#issuecomment-1695903150
I think this is conceptually cleaner, and it handles nested quote types as mentioned in https://github.com/mastodon/mastodon/pull/26701#pullrequestreview-1606429189
The junk rule is not needed anymore, unmatched quotes get matched in a term.
I am not sure of the parsing performance implications.
This comes at a cost, because Parslet does not do any kind of optimization, and the disjunction in prefix_operator significantly increases the work Parslet will do.
I can manually write an optimized version of str(…) | str(…) | …, and we also may want to look at https://github.com/kschiess/parslet/blob/master/qed/accelerators.md or other parser generators in the future as Parslet's goal is not performance.
(Pushed an optimized form that takes care of the cost)
This pull request has merge conflicts that must be resolved before it can be merged.
This pull request has resolved merge conflicts and is ready for review.
This pull request has merge conflicts that must be resolved before it can be merged.
This pull request has resolved merge conflicts and is ready for review.
This pull request has merge conflicts that must be resolved before it can be merged.
Not totally clear to me from previous discussion ... seems like was directionally head-nodded, but maybe a few hangups on small details? Worth pushing forward?
This is 2+ years old with no real updates since initial open ... is this still WIP and actually likely to proceed?
Separately -- needs CI approval and/or rebase to trigger.