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

Review/gh12063 #47

Closed
wants to merge 6 commits into from
Closed

Conversation

Swiftb0y
Copy link

@Swiftb0y Swiftb0y commented Oct 9, 2023

the most important commit (72770f6) has been conflated with the a refactor a little but, but I think the result is much easier to reason about.

}
}
Quoted quoted;
std::tie(argument, quoted) = consumeQuotedArgument(argument, tokens);
Copy link
Owner

Choose a reason for hiding this comment

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

magic...

Copy link
Author

Choose a reason for hiding this comment

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

too much?

Copy link
Owner

Choose a reason for hiding this comment

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

nope. just had to look up what std::tie actually does.

argument = argument.mid(1);
shouldMatchExactly = true;
mode = StringMatch::Equals;
Copy link
Owner

Choose a reason for hiding this comment

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

Initially I wanted to make only super explicit ="string" return exact/equal matches, this change extends it to =string.

Personally I'm fine with that, but it may be a bit confusing that =string does and ="string does not find desired results.

wdyt?

Copy link
Owner

Choose a reason for hiding this comment

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

I think this is also the reason why the TextFilterNode tests fail now
https://github.com/ronso0/mixxx/actions/runs/6461369115/job/17540892333?pr=47

I'll now pick your commits, comment it and push. If that doesn't fix the tests we can revert it.

Copy link
Owner

Choose a reason for hiding this comment

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

Nope, the reason is that = is not considered below, hence :"string" is treated like :="string".
I'll push a fixup.

Copy link
Author

Choose a reason for hiding this comment

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

Personally I'm fine with that, but it may be a bit confusing that =string does and ="string does not find desired results.

Well, I tried to achieve that = means I want to match exactly and "..." means I want to match multiple words. Those compose nicely and thus are easy to understand and apply. The only exception to this is if the string is not quoted completely. In this case I tried to emulate the behavior you implemented, even though I think we need to discuss more whether that makes sense.

I can't quite wrap my head around why

=string does and ="string does not find desired results.

Can you give me an example?

Copy link
Owner

Choose a reason for hiding this comment

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

=string does and ="string does not find desired results.

Can you give me an example?

On second thought, it's perfectly to search contains with unclosed quotes.
I reverted my fixup.

Copy link
Author

Choose a reason for hiding this comment

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

On second thought, it's perfectly to search contains with unclosed quotes.

Right, but the implementation would be simpler if the mode didn't depend on whether the quotes were closed or not. That would get rid of the entire Quoted enum and the pair return type.

@ronso0
Copy link
Owner

ronso0 commented Oct 10, 2023

Thanks for this PR! Very much appreciated.

@ronso0 ronso0 closed this Oct 10, 2023
@Swiftb0y Swiftb0y deleted the review/gh12063 branch October 10, 2023 10:49
@Swiftb0y
Copy link
Author

Thank you, I'm sorry I left the PR in such a broken state. I got too annoyed to fix it yesterday. Thanks for doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants