fix handling of implicit and before parens
authorJoey Hess <joeyh@joeyh.name>
Thu, 28 Jan 2021 17:50:38 +0000 (13:50 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 28 Jan 2021 17:51:07 +0000 (13:51 -0400)
commitc35fa6975bc165f595c6370e801f8c656d931329
tree2f0f68a86e8c5b050a49a845a989b8f10145cf40
parent6f78497572e14d604adf0212fc19170e68aa755e
fix handling of implicit and before parens

Fix an oddity in matching options and preferred content expressions such as
"foo (bar or baz)", which was incorrectly handled as if it were "(foo or
bar) and baz)" rather than the intended "foo and (bar or baz)"

Seemed like a change to consume should be able to handle this case
better, but I was having trouble writing it that way, so instead added
a separate pass that inserts the implicit ands explicitly. Also added
several test cases to make sure versions with and without explicit ands
generate the same.
CHANGELOG
Utility/Matcher.hs
doc/bugs/parens_without_explicit_and__47__or_gives_wrong_matches.mdwn
doc/bugs/parens_without_explicit_and__47__or_gives_wrong_matches/comment_1_8160d9308dc19b3c6a0596f437134e28._comment [new file with mode: 0644]