Generalize String criteria matching#471
Conversation
|
I included the operator Originally I was thinking this could replace the 'spec' definitions, but didn't dig deep enough to see if this is the case or not... |
emersion
left a comment
There was a problem hiding this comment.
Thanks for the patch! Sorry I took way too much time to get back to this.
I think it's a bit confusing to introduce all of these new operators, but only support them on strings. For instance truthy/falsy are not supported on booleans.
Maybe operators could be introduced incrementally on all types they make sense, starting with e.g. regexp which only makes sense on strings.
|
|
||
| enum operator { OP_NONE, OP_EQUALS, OP_REGEX_MATCHES, OP_NOT_EQUALS, OP_TRUTHY, OP_FALSEY }; | ||
|
|
||
| struct mako_condition { |
There was a problem hiding this comment.
This is specific to strings, maybe should be renamed to e.g. struct mako_string_criteria?
There was a problem hiding this comment.
I think I was originally thinking that mako_condition could be used for all of the conditions (and maybe there are other operators that other types of conditions could use, like "in" or "less than"/"greater than" for urgency, group-index).
Since this PR is "Generalize String criteria matching", I didn't want to go too far out of scope and refactor all of the conditions.
But I'm not too invested in this, so if you really want the rename, I will probably do it.
There was a problem hiding this comment.
How would that work? The value field is a char *, but we'd need some other type for urgency/group-index/etc.
7a510ed to
f2ea430
Compare
Closes #306
Most string fields have been changed to support
[app-name~=D..o][summary!=""][summary](equivalent to[summary!=""])[!summary](equivalent to[summary=""])