Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parentheses for complex OR boolean search expressions #6672

Merged
merged 8 commits into from
Aug 1, 2024

Conversation

Alkarex
Copy link
Member

@Alkarex Alkarex commented Jul 31, 2024

Search expressions combining some non-uniform parentheses and OR expressions where failing.
For instance:

  • (ab) OR cd OR ef OR (gh) was wrongly parsed as (ab) (cd OR ef) OR (gh)

Improved the parser, also for expressions involving negations, and add several unit tests.

@Alkarex Alkarex added Search 🔍 Bug (confirmed) 🐞 issues that are reproducable labels Jul 31, 2024
@Alkarex Alkarex added this to the 1.24.2 milestone Jul 31, 2024
Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be an idea to add a couple of bad testcases to ensure predictable failure behavior? (E.g., mismatched parentheses.)

@Alkarex
Copy link
Member Author

Alkarex commented Aug 1, 2024

Could be an idea to add a couple of bad testcases to ensure predictable failure behavior? (E.g., mismatched parentheses.)

Indeed. At the moment, the parser never fails (unfortunately) but that is clearly something to improve, by failing more visibly when there is for instance mismatched parentheses

@Alkarex
Copy link
Member Author

Alkarex commented Aug 1, 2024

Also fixed ab OR !(cd OR ef), which was parsed as ab !(cd OR ef)

@Alkarex Alkarex merged commit 58de38b into FreshRSS:edge Aug 1, 2024
2 checks passed
@Alkarex Alkarex deleted the fix-or-parentheses branch August 1, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug (confirmed) 🐞 issues that are reproducable Search 🔍
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants