JuliaLang/julia — pull request #8061 by mbauman (2014-08-19 21:52:33+00:00)
Title: RFC: Deprecate ambiguous parsing of & and | in combination with comparisons

This is one potential path towards fixing issue #5187 so the bitwise operators `&` and `|` can be used for elementwise array comparisons without parentheses (e.g., `A .< 1 | A .> 2`).

This is pretty hacky, but it's the only way I've been able to get robust deprecation warnings. As far as I can tell, there are no false negatives and only one obscure false positive (`(&)(x,y) == z` requires an unnecessary set of parentheses). I'm definitely digging around in areas above my pay-grade, but I had gotten most of this working a few months ago and figured I'd rebase it and post it as a starting point. I thought that at the very least, the commit that adds parentheses around these operations would be helpful (e602bc53c9a098eaaca6c8c4e9e064a0fe38ce7e). But with a fresh set of eyes I was able to get the deprecations working completely! So here is a PR.

cc: @JeffBezanson and @jakebolewski for your parser smarts. Jake, you have some good parser performance tests, no? This requires a few extra passes through the AST, with modifications, and I'd be curious on its impact. It seems to be fairly negligible in the time to compile Julia (maybe 2-3% worse), but I'm not sure how much of the compile time is spent parsing.