boolean queries have surprising precedence when terms are space-separated
Unless I'm confused, in our boolean queries, OR binds more tightly than AND ?
I don't want to change anyone's queries, but isn't this surprising and opposite to common practice in other systems, where OR is usually lowest precedence ?
Hopefully I'm confused and everything is fine.
Or, boolean queries are still a bit rough, and we have been unaware because we usually don't [need to] push them very hard. See also #2371.
I think I was confused, assuming that space-separated terms inside a boolean query were combined with AND; they're not. I have fixed/expanded the doc at https://hledger.org/dev/hledger.html#boolean-queries and suggested avoiding space-separated terms inside boolean queries.
To be honest I haven't re-tested, but I trust the code comments which say that NOT, AND, OR are processed in that order, ie with standard precedence.
If anyone thinks we should disallow space-separated terms inside boolean queries to reduce confusion, let me know.