mastodon icon indicating copy to clipboard operation
mastodon copied to clipboard

Refactor search query parser and handle nested quote types

Open ClearlyClaire opened this issue 2 years ago • 7 comments

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.

ClearlyClaire avatar Sep 01 '23 08:09 ClearlyClaire

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.

ClearlyClaire avatar Sep 01 '23 09:09 ClearlyClaire

(Pushed an optimized form that takes care of the cost)

ClearlyClaire avatar Sep 01 '23 13:09 ClearlyClaire

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Sep 04 '23 16:09 github-actions[bot]

This pull request has resolved merge conflicts and is ready for review.

github-actions[bot] avatar Sep 05 '23 11:09 github-actions[bot]

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Sep 08 '23 13:09 github-actions[bot]

This pull request has resolved merge conflicts and is ready for review.

github-actions[bot] avatar Sep 08 '23 15:09 github-actions[bot]

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Jun 27 '24 22:06 github-actions[bot]

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?

mjankowski avatar Nov 21 '24 17:11 mjankowski

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.

mjankowski avatar Nov 03 '25 17:11 mjankowski